IntelliJ keeps formatting this:
public void addElement(Element elem) { this.elements.add(elem); }
into this:
public void addElement(Element elem) { this.elements.add(elem); }
I prefer the multi-line formatting. How can I tell this to IntelliJ? I have unchecked the following boxes in Settings -> Editor -> Java -> Wrapping and Braces
Didn't help.
Go to Settings/Preferences | Editor | Code Style, select your programming language, and open the Wrapping and Braces tab. In the Keep when reformatting section, select the formatting rules which you want to ignore and deselect those which should be applied. Reformat your code ( Ctrl+Alt+L ).
Rearrange codePress Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. In the editor, select the code entries you want to rearrange and from the main menu, select Code | Rearrange Code.
You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings.
In Preferences > Editor > Code style > [language] uncheck reformat on file save .
Look in Preferences (or Settings), Editor, General, Code Folding, Collapse by default, One-line methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With