Under Options > Formatting > Braces Placement, the only sections are Class Declaration, Method Declaration and Other. What about Array Initializer, Annotations, Try, Catch, Finally, If, Else, etc...?
I would like to have most of those on a new line, but keep array initializer braces on the same line.
Or perhaps there should be an option in all cases to respect existing code that has the opening brace on the same line as long as the closing brace is also on that line.
And I'd like to keep space around the = operator when used for assignment, bbut not when used in annotations.
I find that we need *at least* braces placement for array and anonymous class initializers. I use the same brace placement for if/for/while/try/catch blocks because semantically, they are more or less the same thing (new scope) but with array and anonymous class initializers the braces mean something different (the interntal definition/state of an instance of an object).
Created attachment 129212 [details]
screenshot of 7.3 beta anonymous class layout
RFE for anonymous class indentation
Not sure what happened to my comment that went with that screenshot above. Anyways, what i was adding was an RFE that would permit the anonymous class to be indented such that its defining braces aligned under the "new" keyword. It's pretty self explanatory if you look at the screenshot.
I'd like to see this feature too.
I'm used to braces on the next line, like so:
With the current settings, Array initializations fall in the same category that ifs, fors, whiles, switches... So I can't reasonably choose to keep it on the same line. Thus, my array initializations take 3 ugly lines.
Would it be possible to at least add a separate setting for array and anonymous classes braces, as already requested?
And here's one more vote for having array initialization treated separately from all the other options!