英文:
Hide "var" type preview in new IntelliJ 2020.2
问题
我刚刚更新到IntelliJ 2020.2,虽然有些方面很好,但也有一些不好的地方。
当使用Java的var
功能时,IntelliJ现在会在变量名称旁边显示它的类型,对我来说完全没有用处,而使用var
的唯一原因是因为类型已经很明显了。
var a = "hello world".split(" ");
在IntelliJ 2020.2中显示为
var a (: String[]) = "hello world".split(" ");
(括号中的类型是一个气球,你无法右键单击或突出显示)
我如何禁用这个无用的功能?
英文:
I just updated to IntelliJ 2020.2 and while some things are good some thing are bad..
When using the Java var
feature IntelliJ now shows the type of it right next to the variable name which is completely useless to me and the only reason one uses var
at all, because the type is already obvious.
var a = "hello world".split(" ");
Displays in IntelliJ 2020.2 as
var a (: String[]) = "hello world".split(" ");
(the type in parentheses being a balloon which you can't right-click or highlight)
How can I disable this useless feature?
答案1
得分: 15
禁用设置(macOS上的首选项)|编辑器|嵌入提示|Java|隐式类型:显示提示:
英文:
Disable Settings (Preferences on macOS) | Editor | Inlay Hints | Java | Implicit types: Show hints:
答案2
得分: 1
我找到了。CTRL+ALT+S,然后搜索Inlay Hints,选择Inlay Hints -> Java -> Implict types并将其关闭。
但愿它在默认情况下是禁用的,因为现在我将不得不在所有地方关闭它。
英文:
I found it. CTRL+ALT+S then search for Inlay Hints and select Inlay Hints -> Java -> Implict types and turn it off.
Wish it was pre-disabled because now I will have to turn it off everywhere.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论