The Eclipse scala plugin has a nice feature which shows you the type of a variable when you hover the mouse over it. How do I see the same information with the IntelliJ plugin?
10 Answers
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.

- 31,222
- 37
- 115
- 186

- 6,920
- 1
- 28
- 29
-
2I think this is what I'm looking for, Ctrl + Q only works for variables not all expressions. – Jon Freedman Oct 22 '11 at 10:29
-
It's not exactly what you're looking for; it's a pain in the butt because you have to reposition your cursor, use a 4-key combination, then reposition your cursor back to where it was. But it's the best that there is, and the only way to get the inferred type of a declaration, rather than a usage. – Luigi Plinge Oct 22 '11 at 11:23
-
71ctrl-shift-P on osx in Intellij Leda – Dustin Getz Mar 27 '13 at 19:04
-
3wow, keyboard shortcuts they keep a-changing. It's peculiar that I find IntelliJ often throwing tooltips on my face unnecessarily, but this one - that actually matters, is hard to reach. Oh well. – akauppi Aug 13 '14 at 11:11
-
1Had to come back here to find it again. IntelliJ could really do better by making this more easy to reach/remember.. – akauppi Sep 23 '14 at 12:00
-
@akauppi you could always re-map it to something you like better :p – grinch Sep 23 '14 at 15:41
-
@grinch Actually, the ctrl/cmd and mouse hover is the easy way. Added a summarizing answer below, for "Mac OS X 10.5+" keyboard layout. – akauppi Sep 23 '14 at 16:48
-
This somehow doesn't work for me on Linux with IDEA 2016.1.1. "Show Expression Type" is greyed out in the Action Menu, I don't know why. – js. May 02 '16 at 09:46
-
See below a comment from @Andrew about making it without show without key stroke – Saar Jan 30 '17 at 11:26
-
Is there a shortcut to add type info? – Jwan622 May 23 '18 at 21:24
On OS X, it's ctrl + shift + P for me. This shows the exact type with resolved generics.

- 21,321
- 14
- 93
- 134
CTRL / Command key and hover over the variable or method.

- 1,406
- 1
- 14
- 23
-
2Its useless , keyboard shortcut is way more precise. In windows its Alt+ = . In mac option + = – Pushpendra Jaiswal Jul 09 '18 at 14:56
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.

- 334,321
- 69
- 703
- 674
-
Looks like Ctrl + Q resolves the parameterized types in the latest plugin version – Jon Freedman Jun 18 '12 at 16:20
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.

- 569
- 4
- 9
-
1Actually this should be the correct answer since @JonFreedman wants to have the same behaviour as in Eclipse. The others answers just give shortcuts to achieve the same, which takes longer than just moving the mouse over the variable – Ignacio Alorre Jun 11 '19 at 10:02
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.

- 1,541
- 14
- 16
-
2One more tip: to easily select an expression press ⎇↑ or ⎇↓ to grow or shrink your selection. – Erik van Oosten Sep 19 '12 at 15:16
-
1+1 OSX 10.7.4, intellij CE 11.1. cmd-= was bound but didn't work, rebinding to something else worked. – Dustin Getz Nov 21 '12 at 19:05
-
1IntelliJ 14, OS X Yosemite: - expression eval type: `CTRL + Shift + P` - single value type (provides more details): `CTRL + J` – Raul Dec 10 '14 at 14:44
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.

- 20,435
- 3
- 55
- 76
-
1I get what looks like the scaladoc of the underlying class when I hold down shift and mouseover, but this doesn't show the full type information, e.g. `val test = Seq(1,2)` shows type info for Seq[+A] not Seq[Int] – Jon Freedman Oct 22 '11 at 09:45
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).

- 318
- 2
- 10
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 expressionalt
+ hover: clicking on the expression inspects its value (very handy!)⌘
+ hover works likectrl
+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.

- 17,018
- 15
- 95
- 120