IntelliJ collapsing single line methods

JavaIntellij IdeaFormattingIntellij 14Intellij 15

Java Problem Overview


Since I've updated my version of intelliJ (14.x to 15.x) it has started automatically collapsing single line methods in the Java editor:

Previous version:

public void setContext(SecurityContext context) {
    this.context = context;
}

Latest version:

public void setContext(SecurityContext context) { this.context = context; }

Is there a way to prevent this? I find the original version much easier on the eyes!

Thanks.

Java Solutions


Solution 1 - Java

Open 'Settings' from the File menu. Under 'Editor' -> 'General' -> 'Code Folding', you will find a 'Collapse by Default' section.

Simply uncheck 'One-line methods' and click OK.

Solution 2 - Java

On Windows:

Settings -> Editor -> General -> Code Folding -> Uncheck "One-line methods"

Solution 3 - Java

For mac, Code > Folding > Expand ALL/To Level

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionStuPointerExceptionView Question on Stackoverflow
Solution 1 - JavarmlanView Answer on Stackoverflow
Solution 2 - JavaToDoView Answer on Stackoverflow
Solution 3 - JavaAtul KaushikView Answer on Stackoverflow