Extension methods, how I understand it, are method...
# intellij
m
Extension methods, how I understand it, are methods defined over some class of objects, so the "grouping unit" for extension is a class object over which this extension is defined. In your case, you want to control a layout of code of extension, not a layout of extension itself cos it defined by extension method declaration. So yes as @orangy said, if assume a package as a grouping unit for code (as well as a file), subpackage is a best candidate to solve your case. More over, there is no other tools to control code layout in the language, only files, packages and modules. ­čÖé