Reputation: 1976
I'm using IntelliJ 12 and It's putting my member variable annotations on the same line, which i hate! How do I setup the code formatter to keep annotations on separate lines?
thanks!
Upvotes: 108
Views: 42403
Reputation: 119
in 2023.2.2 Code Style > Java > Wrapping and Braces tab: Set "Method annotations" to "Wrap always"
Upvotes: 0
Reputation: 932
Nothing seemed to work for me with version 2.3.3 or Android Studio. I gave up and checked Line breaks under Keep when reformatting. I just have to be very careful when I add line breaks.
Upvotes: 3
Reputation: 8885
Navigate to Preferences → Editor → Code Style → Java → Wrapping and Braces tab, then locate the section Field annotations and check the option Do not wrap after single annotation.
In IntelliJ v14:
Upvotes: 151
Reputation: 22382
I think all the above answers are correct but here is step by step for Mac users:
Upvotes: 11