And do you know if it will be available one day or it’s a limitation of Kotlin ?
03/22/2019, 3:53 PM
I don’t know how any tool can safely refactor moving a method from one class to another class (or to a top-level function).
The code that calls this function would not know how to resolve this refactor.
E.g. the calling code has an instance of EditoOffersService and calls getCataglogEditoOffers on it.
If you move getCataglogEditoOffers to the top or to another class, what should the calling code do, how should the calling code be refactored?
03/22/2019, 3:59 PM
For myself, nothing change for the calling code. It’s only a way to simplify a copy/paste in fact to a new file/class (that could be created). And you have to fix your code following this refacto.
03/22/2019, 4:05 PM
Ah… then, yes, you’d need to cut/paste it yourself.
Refactoring is more involved and refactoring must be done safely, ie the functionality of your app shouldn’t change and the IDE must be able to change both ends of the code (declaration/implementation on one side, the calling code on the other side) if necessary.
Alexey Belkov [JB]
03/25/2019, 8:04 AM
If Move refactoring works for instance methods in the Java plugin, it can probably work for Kotlin too. Please submit a feature request at http://kotl.in/issue with sample code. Thanks.