How to force braces onto the next line
已回答
Is there some combination of settings that would allow the auto formatter to put braces on new lines for things like if/while/for/try/etc?
No matter what I do or set, braces are put on the same line as the opening conditional and not on the next line. Braces for things like classes and methods go to the next line, but other things don't.
I'm probably in the minority in liking things to be formatted that way, but nevertheless.
If it's not possible, is there a decent (and recent) external formatter that's more configurable? Do I have to also install eclipse to use it as formatter or is there a better way?
请先登录再写评论。
It's broken down by "class", "method", and "other" in the formatter settings.
Settings -> Code Style -> Java (assuming) -> Wrapping and Braces
and it's listed under "Braces Placement", you want "Next line".
I have all of those three set to "Next Line" but it doesn't have any effect for conditionals and so on. Not sure if there is a bug or some other setting I have turned on is causing it to ignore that one or what.
Guessing bug since in V11 this doesn't work but in V12 the exact same settings work as expected.
This post can be removed as it was made in error.
Well I experience this too, but I am using the newest version. Hope they will fix this as quickly as it's possible.
Xjakma01 It has been fixed long time ago.
Are you sure you have this option set?
Yeah, have this turned on definitely, and so for methods and classes
As a general troubleshooting step, please reset settings to default via File | Manage IDE Settings | Restore Default Settings
If it does not help, please share the complete [logs folder](https://intellij-support.jetbrains.com/hc/en-us/articles/207241085) compressed and code sample to reproduce by creating new YouTrack ticket: https://youtrack.jetbrains.com/newIssue?project=IDEA