47

In Eclipse I have set the Javadoc Location property of my Scala project to file:/D:/EclipseWorkspace/MyProject/target/scala-2.9.1/api where D:/EclipseWorkspace/MyProject is the location of my scala project.

Now, if I am in a Scala file that implements a class/trait, when I type Shift+F2, Eclipse opens the Scaladoc page of that class/trait. However, this does not work if it is an object since Eclipse tries to open <ObjectName>.html whereas the Scaladoc-generated file name is <ObjectName>$.html.

Is there any workaround?

GingerHead
  • 8,130
  • 15
  • 59
  • 93
dips
  • 1,627
  • 14
  • 25
  • 8
    AFAIK, no. In fact, even _inside Scaladoc itself_ one cannot link to objects. If you look at the pages I wrote, like Regex or the stuff inside scala.sys.process, you'll see the convoluted way I refer to them, instead of simply linking to them. Mind you, I'm not claiming Scaladoc's limitation has anything to do with Eclipse's limitation. – Daniel C. Sobral May 03 '12 at 17:55
  • 1
    @Daniel C. Sobral. Thanks. If it doesn't work in Scaladoc itself, one can not expect it to work with eclipse javadoc mechanism. I was just hoping that if we know the mangled names of the generated class files for the objects then we can somehow trick Eclipse to open the corresponding html. (This will be just a temporary workaround since the mangled names might change in future versions of scala/scaladoc) The ideal way would be scaladoc supports object links and then Scala-IDE overrides `Shift-F2` – dips May 04 '12 at 05:01
  • 6
    Having tried a few different setups of Eclipse and scala versions, I've never been able to get anything more than code completion to operate, and have often wondered how (if possible) to see JavaDoc information in realtime – LaloInDublin Nov 01 '12 at 06:29
  • 3
    The scaladoc intergration is mentioned in this issue: https://www.assembla.com/spaces/scala-ide/tickets/1000860 It seems it's still a while before it's added. – EECOLOR Feb 18 '13 at 22:26

2 Answers2

16

Scaladoc is now integrated since release 4.0.0 RC1 of the Scala-IDE plugin. You can just hover over your term, or press F2 while the cursor is on the identifier.

Francois G
  • 11,957
  • 54
  • 59
4

Typesafe has announced a plugin for the Scala compiler which generates JavaDoc for your Scala API. The plugin and its documentation is available on github. Maybe this helps as a workaround.

GingerHead
  • 8,130
  • 15
  • 59
  • 93
akkie
  • 2,523
  • 1
  • 20
  • 34