5

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

codingsplash
  • 4,785
  • 12
  • 51
  • 90

2 Answers2

10

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__
  • 66,707
  • 21
  • 171
  • 266
  • 1
    @user567 looks like you are missing the sources for Akka. Is using an sbt project an option? That makes everything much easier, as IntelliJ will take care of downloading the library sources. Otherwise, check in Project Structure > Project Settings > Libraries > Akka that you have added Akka sources. – 0__ Jan 03 '17 at 10:54
  • Thanks for pointing out that my Akka sources are missing. Where can I get the Akka source docs as a jar file? I could not find it in the Akka website. – codingsplash Jan 03 '17 at 11:00
  • 1
    For example here: http://search.maven.org/#search|ga|1|g%3A%22com.typesafe.akka%22%20a%3A%22akka-actor_2.11%22 – 0__ Jan 03 '17 at 11:10
0

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.

Jonas Gröger
  • 1,558
  • 2
  • 21
  • 35