score:132

Accepted answer

Select expression and type Alt + =.


If you want to change the shortcut go to Preferences > Keymap and enter "Type Info" in the search field.

In older versions, it's Shift + Ctrl + Alt + T.

score:0

In Windows . Alt + = In mac . option + =

score:1

There's good tips gathered around here, but since the mappings vary by the keyboard bindings, here's a summary for the Mac OS X 10.5+ bindings.

  • ctrl + hover: show the type of the expression

  • alt + hover: clicking on the expression inspects its value (very handy!)

  • + hover works like ctrl+hover, but also allows clicking the link to go to other references of the expression (ctrl+click obviously doesn't because it is regarded as right click in OS X).

Note: The Mac OS X 10.5+ bindings are still not the default in IntelliJ 13.1, but they really should be. They have a more native OS X feel than the old Mac OS X bindings. You can activate them via Preferences > "keyboard" (in the search field) > Keymap > Keymaps: Mac OS X 10.5+

The real usability problem with these (as of IntelliJ 13.1) is that one needs to hold the key, then move the cursor. It should ideally also work when you have the cursor already on the expression, then start keeping ctrl/alt/cmd pressed in. I'll request them for this.

ps. I know it's OS X, officially, not Mac OS X. IntelliJ IDEA still uses the old naming at least for the keycaps.

score:3

For OS X, use ctrl + J on a variable, function or signature to get full definition, type, and parameters. Use ctrl + shift + P for evaluated type (this also works on highlighted code block or expression).

score:5

Hold down the Command key as you mouseover. Note: I tested this on Mac OS X with standard keybindings. Different OSes or non-standard keybindings may of course be different, but the functionality is certainly there.

score:20

In IntelliJ 2016 and later with Mac OS X 10.5+ keybindings the keybinding is Ctrl++P.

Old answer:

Under MacOS with Mac OS X 10.5+ keybindings, it is supposed to be +=, however that does not seem to work at all (for me).

In the settings (Preferences > Keymap and enter "Type Info" in the search field), I added the shortcut Ctrl++T to the action. This shortcut works fine.

score:23

You can set IntelliJ up sort of like eclipse. Go to:

File -> Settings -> Languages & Frameworks -> Scala

and then tick "Show type info on mouse hover after, ms" and set your preferred timeout.

This works well except that other messages seem to take preference. The most common being "Declaration is never used" which is quite a lot of the time if you have just written a val and want to see it's type. Then you have to resort to (Alt + =) for PC or (Ctrl + Shift + P) forMac.

score:36

You can hit Ctrl + Q on a variable or method signature to view its type.

There is also a neat trick to view type of any expression: select the expression and type Ctrl + Alt + V. This will show Extract variable dialog with expression type to be extracted shown for convenience.

score:38

CTRL / Command key and hover over the variable or method.

score:50

On OS X, it's ctrl + shift + P for me. This shows the exact type with resolved generics.


Related Query

More Query from same tag