1

I want to know if there is a way in intellij to know the type of a val with a shortcut or a button?

For instance:

val t = 3

If i select t and do a certain shortcut, can I know that t is ant integer? Thanks

gerard
  • 13
  • 2
  • 6
    Possible duplicate of [How do I view the type of a scala expression in IntelliJ](http://stackoverflow.com/questions/7858588/how-do-i-view-the-type-of-a-scala-expression-in-intellij) – Mykhailo Nov 10 '16 at 11:16

2 Answers2

1

According to How do I view the type of a scala expression in IntelliJ, Alt + = on expression should work.

Another option would be Ctrl + Q - quick documentation lookup. It could be used nearly anywhere in editor, and is capable to show documentation for type, type of variable, etc.

Community
  • 1
  • 1
Mykhailo
  • 1,134
  • 2
  • 17
  • 25
0

You can select your val or var and press Ctrl + Alt + e This will add to your code the type of your val. On your exemple, you will get:

val t: Int = 3
a.moussa
  • 2,977
  • 7
  • 34
  • 56