IntelliJ IDEA Scala 插件具有自动添加功能:Unit
到单位返回函数的末尾。例如,如果我正在编写一个有副作用的函数foo
:
def foo() {}
当我击中Enter
当光标位于大括号之间时,我将得到以下内容:
def foo():Unit = {
}
我个人更喜欢以下内容:
def foo() {
}
那么,如何关闭该功能呢?
tldr;
Preferences > Code Style > Scala > Other > Uncheck: Enforce procedure syntax [blah blah blah]
- 打开IntelliJ
Preferences
dialog
- 在右侧面板中展开
Code Style
- Select
Scala
- 单击标题为的选项卡
Other
- Uncheck
Enforce procedure syntax for methods with Unit return type
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)