如何在IntelliJ IDEA中关闭单元返回类型的Scala自动完成功能?

And*_*rey 7 scala intellij-idea

IntelliJ IDEA Scala插件具有自动添加:Unit到单元返回功能结束的功能.所以,例如,如果我正在编写一个副作用函数foo:

def foo() {}
Run Code Online (Sandbox Code Playgroud)

当我Enter在光标位于大括号之间时,我会得到以下内容:

def foo():Unit = {

}
Run Code Online (Sandbox Code Playgroud)

我个人更喜欢以下内容:

def foo() {

}
Run Code Online (Sandbox Code Playgroud)

那么,我该如何关闭此功能呢?

And*_*rey 12

tldr;
Preferences > Code Style > Scala > Other > Uncheck: Enforce procedure syntax [blah blah blah]
Run Code Online (Sandbox Code Playgroud)
  1. 打开IntelliJ Preferences对话框
  2. 在右侧面板展开 Code Style
  3. 选择 Scala
  4. 单击标题为的选项卡 Other
  5. 取消选中 Enforce procedure syntax for methods with Unit return type