Another offtopic: is there a function/plugin for I...
# tornadofx
a
Another offtopic: is there a function/plugin for IDEA to sort methods/inner classes/enums alphabetically, like Eclipse's sort methods?
a
it offers to sort lines, but not the functions
s
hmm it seems in
settings > editor > code style > java
there is an arrangement tab. By default none of it has sort by name, but its a property you could set. however there doesn't seem to be a similar tab for kotlin. Probably because the kotlin style guide basically says NOT to do that.
a
Well, pure alphabetic is usually not good, but eclipse sorting does more than that. It lifts statics along with classes to the top, fields and ctors are next, then everything else is sorted alphabetically
s
yeah thats in idea too for java, just not for kotlin. The kotlin style guide puts emphasis on putting like things together over sorting by type or visibility.
i assume that is why the arrangements tab doesn't exist for the kotlin code style settings
a
I read about it, but honestly I can't see their motivation. It seems like because of language flexibility they couldn't find good universal style or didn't want to force any style on users
s
this is entirely personal right, but in the past i've done the same thing you are trying to do, mostly sort by scope and visibility, but what exactly is that buying you? On one hand, it creates a consistent "shape" to your files which is nice when scanning visually. On the other hand, there's a good chance you'll be hopping around the file while following the code, because like minded fields and methods are not organized together. Its mostly a personal (or corporate) choice of course, but i can see where they are coming from. I DO wish IDEA kept the arrangements tab around though, just for those who already have a workflow.
a
I don't use it for scope, rather for quick symbol orientation. It's easier for me personally. I know that where statics, classes, fields are. For method navigation I use special window with masking/camelCase search.