Using IntelliJ, how can i determine whether particular function stems from Java or Scala

intellij-idea, java, scala

Solution

In IDEA's autocompletion, bold entries are methods defined on the type of the object itself, while underlined functions are added by implicit conversions and pimp-my-library (for explanation, see for instance here or search on StackOverflow or Google).

However, for the special case of types which are defined in Java (like `String`, the type of `m`), you happen to be right on the Java-vs-Scala distinction: there bold methods are real methods, which must be defined within the type of `m` (here `String`) and thus in Java. While pimp-my-library is a Scala pattern, so typically underlined functions will be written in Scala (this is just a rule of thumb, but I've never yet seen an exception).

Non-bold functions are simply inherited.

For the amount of documentation, as a rule of thumb the Java standard library has quite comprehensive documentation (it's supposed to be a specification for the method) while Scala varies typically between less and much less documentation.

I've searched for how to change the fonts used for this highlighting in IntelliJ 11, but I've not found much - you can change fonts used to highlight the code, but I suspect that doesn't make a difference here.

Problem

Lets take a ``` val m = "Scala is fun" ``` `IntelliJ` helps figure out a lot of things that can be done with this Is there a way for me to know which of these functions come from Scala and which ones come from Java?

Original source