Reputation: 12766
Scala
is installed using homebrew
, and when I create a new Scala project, I use the path /usr/local/opt/scala/idea
with the proper symlinks
IntelliJ detects the compiler and libraries correctly, auto-complete, compilation and running works fine.
The problem is IntelliJ does not detect the Scala API documentation, even though the Javadocs path is correct
The contents of the directories look correct too:
hanxue-mac:idea hanxue$ ls doc/scala-devel-docs/api index index.js package.html index.html lib scala hanxue-mac:idea hanxue$ ls /usr/local/opt/scala/idea doc lib src hanxue-mac:idea hanxue$ ls /usr/local/opt/scala/idea/doc/scala-devel-docs/api index index.js package.html index.html lib scala
This is a screenshot when I select a Scala class and press Ctrl+J
Note that I have the same problem in IntelliJ Idea 132.719
as well as IntelliJ Idea 12 CE
. How should I set up the Javadocs path for Scala API?
Upvotes: 4
Views: 5750
Reputation: 67280
I know I am giving this answer repeatedly, but... If you set up your project with sbt and sbt-idea (task gen-idea
), you get a correctly set up scala-library with documentation.
Here is a screenshot of an example project, perhaps you can use this approach manually—it uses a dedicated jar scala-library-2.10.3-javadoc.jar
instead of pointing to an extracted API folder:
IDEA seems to have problems with type aliases (e.g. import collection.immutable.{IndexedSeq => Vec}
means it won't look up the doc of Vec.empty
), but in general it works as expected:
(Oops, doesn't paste in doc macros, like $bfinfo
and $thatinfo
:)
Upvotes: 5