In Intellij IDEA, inside a method, you can write something as:
myNewMethod(someParam);
Then if you go with the cursor on myNewMethod
and then Alt+Enter (or Command+Enter on Mac) you can choose Create method 'myNewMethod'
which will create the new method with the expected parameters and return type.
The problem is that this new method is created immediately after the method which is in, and not at the end. I would like to generate it at the end of the class.
For example I have a public method and I generate the 3 methods in order:
public methodPublic() {
myGenerated1();
myGenerated2();
myGenerated3();
}
it will end up generating them:
public methodPublic() {
myGenerated1();
myGenerated2();
myGenerated3();
}
private void myGenerated3() { ... }
private void myGenerated2() { ... }
private void myGenerated1() { ... }
As far as I know still there is no option in Intellij Idea to insert generated method to end of the file except getters and setters. But you can sort them in alphabetic order.
Go to File > Setting > Editor > Code Style > Java > Arrangement Tab
. Click on the small pencil icon which is placed next to item called method
under Matching Rules
section.
In there select order by name
option from Order
dropdown.
You can create feature request in https://youtrack.jetbrains.com/issues/IDEA
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