如何在IntelliJ IDEA中关闭单元返回类型的Scala自动完成功能? [英] How to turn off Scala auto-completion of function with Unit return type in IntelliJ IDEA?
本文介绍了如何在IntelliJ IDEA中关闭单元返回类型的Scala自动完成功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
IntelliJ IDEA Scala插件具有自动添加:Unit
到单元返回功能结束的功能。所以,例如,如果我正在写一个副作用函数 foo
:
IntelliJ IDEA Scala plugin has a feature for automatically adding :Unit
to the end of unit-returning functions. So, for example, if I'm writing a side-effecting function foo
:
def foo() {}
当我点击 Enter
当光标在大括号之间时,我会得到以下内容:
when I hit Enter
while the cursor is between the braces, I'll get the following:
def foo():Unit = {
}
我个人更喜欢以下内容:
I, personally, prefer the following instead:
def foo() {
}
那么,我该如何关闭此功能呢?
So, how do I turn this feature off?
推荐答案
tldr;
Preferences > Code Style > Scala > Other > Uncheck: Enforce procedure syntax [blah blah blah]
- 打开IntelliJ
偏好设置
对话框 - 在右侧面板中展开
代码样式
- 选择
Scala
- 点击标题为
其他
的标签 - 取消选中
为单位返回类型的方法强制执行过程语法
- Open IntelliJ
Preferences
dialog - In the right panel expand
Code Style
- Select
Scala
- Click on tab titled
Other
- Uncheck
Enforce procedure syntax for methods with Unit return type
这篇关于如何在IntelliJ IDEA中关闭单元返回类型的Scala自动完成功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文