score:132
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 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.
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.
Source: stackoverflow.com
Related Query
- How do I view the type of a scala expression in IntelliJ
- How to find the type of a Scala expression
- How the get the classOf for a scala object type
- How are Scala collections able to return the correct collection type from a map operation?
- How to get Scala imports working in IntelliJ IDEA with the Play framework?
- How to use the function type in scala within defined in type meaningfully?
- How do I get IntelliJ to display the Scala compilation deprecation warnings
- how to show the type of a HList in scala shapeless
- How to show images using Play framework and Scala in the view page
- How to disable the method return type hint in IntellijIdea scala plugin
- How to turn off Scala auto-completion of function with Unit return type in IntelliJ IDEA?
- How does the Scala type checker know to prevent calling flatten on a List that is already flat
- How do you attach the Scala Intellij debugger for tests?
- scala: how to create a generic type which is subtype of all the number classes in scala so that it can include compare method
- Scala on IntelliJ with Git: How should the .gitignore look like?
- How do I get the runtime Class of a parameterized Type in a Scala trait
- How do I know the type of a scala function
- How to ask for the same type in Scala generics without introducing a third type parameter?
- How does the Scala type system know that cons + Nil is exhaustive?
- How can I ensure that the dynamic type of my custom Scala collection is preserved during a map()?
- In scala 2.11+ how to use exactly the singleton type as type evidence?
- How to store the intermediate results of a scala match expression into a list?
- How to get the proper return type when using a filter based on type in Scala
- How to write efficient type bounded code if the types are unrelated in Scala
- How to see the type of a scala variable? For instance a Spark PairRDD
- In Scala how do I define upper type bounds that are exclusive of the defined class?
- How can I create a generic list monoid in scala that maintains the inner type of the list involved?
- Scala - how come using a super-type with two generic parameters cause the scala type checker to treat the child-type differently?
- How can an object in Scala be cast to the intersection of its own type and any unrelated trait?
- How to compare the return type of a method to a Scala native or TypeTag?
More Query from same tag
- How to make AndroidScheduler.mainThread work with a Scala Observable?
- Avoid making the same assertions on data in SQL Language as you do in your domain
- Patches in scalatest
- Parsing XML with scala not working
- FunSuite missing even though ScalaTest is imported
- Scala: Whats the difference between "Map" vs "Set"?
- Scala: Is there a function that returns a child object's parent?
- Cast Exception When trying to cast a Coordinate Matrix
- How to cast a WrappedArray[WrappedArray[Float]] to Array[Array[Float]] in spark (scala)
- how to format a number/date in play 2.0 template?
- Can I use SELECT from dataframe instead of creating this temp table?
- Debug Docker application built with SBT Native Packager
- Scala: Find the DTD declaration in a file
- LZW TIFF decoding
- How to use connection pool to postgresql in spark
- scala, general purpose transform function for all objects
- IntelliJ "Cannot infer Scala class path..." but Gradle testCompile is correct?
- Stack memory implementation not working properly in chisel for rocket chip
- the result type of an implicit conversion must be more specific than AnyRef
- Sort RDD based on a value in a tuple in Scala
- How to get Seq of elements which were grouped in GROUP BY clause?
- Using Spark 2.3.1 with Scala, Reduce Arbitrary List of Date Ranges into distinct non-overlapping ranges of dates
- Unable to write parquet data on local using spark by appending timestamp at the end
- Debug Gatling Scala Code in Intellij with Maven Java Project
- Could not import the newly generated play framework project into IntelliJ IDEA 15
- is there a way to mock Instant.now
- Shapeless: Could not find implicit value for updater
- Tree in scala swing
- Need to flatten a dataframe on the basis of one column in Scala
- ClassCastException when trying to insert with Squeryl