java IntelliJ 折叠单行方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35995083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 00:51:48  来源:igfitidea点击:

IntelliJ collapsing single line methods

javaintellij-ideaformattingintellij-14intellij-15

提问by StuPointerException

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

自从我更新了我的 intelliJ 版本(14.x 到 15.x)后,它开始自动折叠Java编辑器中的单行方法:

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.

谢谢。

回答by rmlan

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.

只需取消选中“单行方法”并单击“确定”。

回答by ToDo

On Windows:

在 Windows 上:

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

设置->编辑器->常规->代码折叠-> 取消选中“单行方法”

回答by Atul Kaushik

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

对于 mac,代码 > 折叠 > 展开全部/到级别