How do I view the type of a scala expression in IntelliJ

前端 未结 10 1027

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 plu

相关标签:
10条回答
  • 2020-12-07 12:34

    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.

    0 讨论(0)
  • 2020-12-07 12:36

    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.

    0 讨论(0)
  • 2020-12-07 12:40

    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).

    0 讨论(0)
  • 2020-12-07 12:42

    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.

    0 讨论(0)
提交回复
热议问题