-->

Setting up Javadoc for Scala projects in IntelliJ

2019-05-15 00:42发布

问题:

After setting up my Scaladoc, i see that some documentation is still missing from the IDE

It seems to me (many thanks to Peter for noticing this) that:

  • functions with non-bold font have no documentation
  • functions with bold font have bare minimum
  • underlined functions have complete documentation

No documentation (normal non-bold font)

Bare minimum documentation (bold)

Complete documentation (underlined)

For the record, my scaladoc is installed as follows

doc
├── scala-devel-docs
│   └── api
│       ├── index
│       ├── lib
│       └── scala
│           ├── actors
│           │   ├── remote
│           │   └── scheduler
│           ├── annotation
│           │   ├── meta
│           │   └── unchecked

and is configured as follows:

EDIT:

Downloaded Javadoc from Oracle and placed into the /Library/Scala/2.10.0-RC2/doc/javadoc

javadoc/api
├── index-files
├── java
│   ├── applet
│   │   └── class-use
│   ├── awt
│   │   ├── class-use
│   │   ├── color
│   │   │   └── class-use
│   │   ├── datatransfer
│   │   │   └── class-use

Added 1 more entry to IDEA:

Does not seem to help.

Please clarify

回答1:

You should install Javadocs as well - those bold methods have in fact plenty of documentation because they come from Java. On the meaning of highlighting, I've answered on your other thread.

To add the JavaDocs, take a look at the picture below: .

From your snapshot, I'm tempted to guess you added them next to the ScalaDocs for the same library. However, the JavaDocs/ScalaDocs are associated with a specific library, so you should undo the step you did - IDEA will only look for docs of Scala library classes within the paths you specified there. The picture shows that within the "Project structure" dialog, you need to go to SDKs, select the Java SDK you're using, go to documentation paths and press one of the "+" buttons on the bottom. The picture shows how to add a link to the Internet documentation, but with the other "+" button you can add the local documentation you downloaded (which will be faster to access). The path you specified seems correct.