I’m searching for a way in eclipse to automatically align the arguments of multiple method calls.
e.g.
Input:
method( arg1, longarg2, anotherArg3);
method(arg1,arg2,aArg3);
method(argument1, arg2, anotherArg3);
method( argument1,longarg2,anotherArg3,extra);
Output:
method( arg1, longarg2, anotherArg3 );
method( arg1, arg2, aArg3 );
method( argument1, arg2, anotherArg3 );
method( argument1, longarg2, anotherArg3, extra);
Eclipse command, formatter setting, a plugin, every way wins.
This is not possible with Eclipse standard tooling.
That said, it is also not necessary. If you have multiple calls to the same method and want to align the arguments in such a way, this indicates bad code style, because there is a lot of code duplication in your code. So instead think about how to refactor your code to avoid these repeated method calls. E.g. have the arguments in a collection and iterate over the collection instead.