IntelliJ IDEA one-line function formatting

https://*.com/questions/36294708/intellij-idea-one-line-function-formatting

 

65

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

  • Control statements in one line
  • Simple blocks in one line
  • Simple methods in one line

Didn't help.

Share Improve this question   asked Mar 29 '16 at 20:43 IntelliJ IDEA one-line function formattingAtte Juvonen 4,24055 gold badges3737 silver badges7575 bronze badges Add a comment

2 Answers

ActiveOldestVotes 92  

Look in Preferences (or Settings), Editor, General, Code Folding, Collapse by default, One-line methods

IntelliJ IDEA one-line function formatting

    answere
上一篇:VBA生成各个超链接目录 (带冻结首行)


下一篇:安卓真机或者模拟器运行安装应用时提示 Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]解决办法