Scala Docs in IntelliJ

5.8k views Asked by At

How do I access Scala docs in IntelliJ? The other answers in SO are for earlier versions. I added the scala doc jar file, but still I am unable to link scala docs with IntelliJ.enter image description here

I do get the Quick Documentation as shown: enter image description here

But I want the complete doc as here

Also, clicking on the Actor hyperlink shows me this code, but not the API doc. There are the download and Attach sources link and I dont understand what they are. enter image description here

2

There are 2 answers

3
0__ On BEST ANSWER

What do you mean by "link scala docs"? You can get documentation for a symbol (class, method) by pressing Ctrl-Q (or menu View > Quick Documentation). This seems to work at least with sbt based projects, even if in Project Structure > Project Settings > Libraries > SBT: org.scala-lang:scala-library:2.12.1:jar there is only classes and sources, and no explicit pointer to javadocs (I guess IntelliJ might extract them directly from the sources).

enter image description here

Also, are you using the latest version of IntelliIJ and the Scala plugin? For me, if I create a global Scala SDK (which you don't actually need when you use sbt build projects), IntelliJ by default does not have javadocs checked, but sources, and again I think it will extract the documentation from the sources. This is how it looks here with IntelliJ IDEA 2016.3.1 and Scala plugin 2016.3.5:

enter image description here

0
Jonas Gröger On

I added this:

Scala Global Libraries to make it work. From the +, choose Scala SDK, select the version that matches your project and then add it to the module of your choice.