First of all, I Google it, and find no answer to this. Also, I've found some questions here, but they dated 2016 and 2017. Now we have 2019.
I'm used to Java in Android Studio. When I override methods, IDE puts them in order - how they placed in parent class or implemented interface.
Also when I'm developing, for example, Repository pattern:
I create an interface.
Create classes which implements this interface
When I am adding functions in interface and then I override (ctrl+o, or alt+Enter on class name) them in my classes: In Java they placed at the same position as they defined in my interface, In Kotlin - the placed in top of the class (this is really bad!)
Also, code does not get reformatted automatically, for example: global vars placed on top, then goes constructors, etc.
So I'm asking.
It's just me? I've tried deleting all Android Studio settings, reinstalling, etc. It did nothing. Also, Googling did not take any results.
Is there any solution to all of this? Because I really liked kotlin, but this inconvenience is just very annoying.
Maybe this plugin Kotlin Code Sorter can fulfill your request. But this plugin only distinguishes the property, class, constructor or function. That the differences are inside some topics likes private, lateinit, val or var can not be order.
Android Studio/IntelliJ official doesn’t have support for the Kotlin code rearrangement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With