How to make Intellij IDEA show Java type hints for inferred local variables only on hover?

814 views Asked by At

Intellij IDEA shows type hints for variables created with the new 'var' feature from Java 10.

However, inferred types are so long sometimes that the line length ends up exceeding the width guide as you can see in the screenshot below:

enter image description here

Is it possible to make Intellij IDEA only show type hints on hover?

2

There are 2 answers

0
CrazyCoder On

It's not possible at the moment, you can vote for the linked feature request.

0
Peter On

Workaround

Disable type hints for implicit types: enter image description here

Use show type info on expression you want to see the type for.

Shortcut on windows Ctrl+Shift+P enter image description here