eclipse-jdt / eclipse-jdt/eclipse.jdt.ui
Arguments don't align vertically in method declarations and calls
- Dominant language
- Java
- Stars
- 59
- Forks
- 127
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 28
Description
From a brief glance at the internet, I notice this issue has been raised (and solved) before, but it seems to have come back. Perhaps that was intentional? Anyway, I think it's important.
When declaring a new method, or invoking an existing one, I prefer to align arguments vertically when wrapping becomes necessary, like so...
```
class Example {
void aMethodWithALargeNameToClearlyShowNonVerticalAlignment(int arg1,
int arg2,
int arg3,
int arg4,
int arg5,
int arg6) {
}
}
```
At the moment, the arguments that get wrapped (i.e. arg2,arg3 etc) are indented, so they don't sit underneath the first argument, which means I need to consciously group them together in my mind, rather than them "visually" sitting together, in a single column on the page.
Inside the java formatter settings, this looks like it ought to be configured under (or somewhere near):
[Line Wrapping -> Wrapping Settings -> Method Declarations -> Parameters = "Wrap all elements, except first element if not necessary".
But instead, things look like so...
```
class Example {
void aMethodWithALargeNameToClearlyShowNonVerticalAlignment(int arg1,
int arg2,
int arg3,
int arg4,
int arg5,
int arg6) {
}
}
```
Is this configurable in the most recent version of the IDE?
I observe this behaviour in:
**Spring Tool Suite 4
Version: 4.17.1.RELEASE
Build Id: 202301011401
Revision: 394b6c753a82ab73b912e8efdc97c92d30d07dfc**
Thanks for your help!
Contributor guide
Assessment
This issue has not been assessed yet.