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

前端 未结 10 1037

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条回答
  •  萌比男神i
    2020-12-07 12:32

    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.

提交回复
热议问题