Search code examples
eclipsescaladocumentationjavadocscaladoc

Eclipse Scala plugin not showing documentation for classes and methods in scala projects


I installed the scala plugin through eclipse (Mars) and experience problems when it comes to documentation. When I am creating a new Java project and write code I get documentation when hovering over classes and their methods as usual.

However when I make a new Scalaproject it does not work. For example:

...
var s: String = "test"
println(s.charAt(1))
...

Now when I hover over String or charAt I only get

def charAt(x$1: Int): Char

in the little box that appears. Note, not only do Java classes and their methods not have any documentation but also Scala methods and classes.

I already tried reinstalling the whole setup as well as using the Scala IDE that can be downloaded directly from Scala IDE

I found other problems with this, however they are all from a year back or earlier and during that time there was a bug. This bug however has been set to fixed a long time ago.

What does work is self made scaladoc above methods and classes but thats it.

Can anyone help me to fix this? Javadoc path is set in the rt.jar as well so I am really out of ideas.

Thanks!

Update I tried the following:

var cc: Array[String]
cc.(code completion)

and got documentation for some methods like "apply" etc. However I still do not get any documentation when hovering over string like in here: Scala IDE introducion video

What I get is

type String = String

Not very helpful...


Solution

  • The behavior you see is the current behavior of Scala IDE. The Scala Hover can't show Javadoc right now, see this open ticket. This is a regression, in a previous version of the IDE it did indeed work.