Hide “var” type preview in new IntelliJ 2020.2

Tags: ,



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?

Answer

Disable Settings (Preferences on macOS) | Editor | Inlay Hints | Java | Implicit types: Show hints:

Implicit types hints



Source: stackoverflow