Any way to show invoking type in Content Assist?

IDEA pops up a list of possible methods to invoke after the user types a period. This is a fantastic feature. However, Scala is fluid enough that, unlike in Java and depending on the code, it may not be obvious what type was inferred in the process of looking up invokable methods. Is there any way to configure IDEA so that it shows the type of the invoking instance, as well as the callable methods?

Thanks,
Ken

4 comments
Comment actions Permalink

Do you mean type after implicit conversion?

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

No, although showing a list of allowable implicit conversions in Content Assist woud be a nice feature, now that I think of it. Let's say I'm typing along, and have typed:

     val y = x.foo.bar.

and Content Assist pops up showing a list of methods that are legal to type following "bar.". That list will be the methods for some class T, and I simply want to know what T is. This isn't needed much in Java because its less powerful type and inference engine means there is likely to be a type declaration nearby, but in Scala, particularly when looking at another person's code, it's easy to lose track of what T is. (Not so much in the above example, but that was just to let me anchor my request to an example.)

Cheers,
Ken

0
Comment actions Permalink

What you call "Content Assist" is Completion feature. Sometimes people use it to get some information, but usually this popup helps us just to type faster and to avoid typos. Currently I even don't know where I can add this information to completion popup. What you want is type info feature. You can call it on selection (any expression) or on definition, or on reference.
For selection this is evenh more powerful feature, it shows you expected type and original type (before implicit conversion, for example). Current shortcut for this feature is "Alt/Meta =".

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Thanks, just needed to know what to search for! For the benefit of others: http://devnet.jetbrains.net/message/5262136#5262136

0

Please sign in to leave a comment.