Repository navigation
Javadoc support for referencedLibraries? #2984
Description
Activity
We have found issues that are potential duplicates:
- Support for val in lombok #2983 (61.31%)
If any of the issues listed above are a duplicate, please consider closing this issue & upvoting/commenting the original one.
Alternatively, if neither of the listed issues addresses your feature/bug, keep this issue open.By default, a referenced {binary}.jar will try to search {binary}-sources.jar under the same directory, and attach it as source if one match is found.
If you want to manually specify a JAR file as a source attachment, you can provide a key-value map in the sources field:
"java.project.referencedLibraries": { "include": [ "library/**/*.jar", "/home/username/lib/foo.jar" ], "exclude": [ "library/sources/**" ], "sources": { "library/bar.jar": "library/sources/bar-src.jar" } }In this way, bar-src.jar is attached to bar.jar as its source.
Yeah it seems some commenters on stack overflow are confused about sources vs compiled javadoc as I found plenty of people say that VSCode can display javadoc, while in reality it would just read the manifest and download sources in the background.
We found it simpler to handle both sources and javadoc from a single (source) jar file.
We could very well add similar support for *-javadoc.jar, but I don't think this will be used that much.
@Hexorg My bad, I misunderstood your problem.
Thanks everyone! I guess overall, I found a workaround by mapping sources to binaries. I didn’t know “sources” key mapping existed in the config before I made this ticket. At the same time javadoc jars are still ignored so I don’t know if you want me to close this ticket or keep it open.
Being able to handle binary + javadoc jars without requiring the source jar would be very useful indeed.
I find it surprising that vscode-java doesn't include that possibility.
Situations where you don't want to disclose java sources are frequent.
If people are willing to distribute their sources, I no longer even understand why classes would remain useful to distribute altogether, as well as javadocs.I am probably missing something.
Is this issue still alive ? That would be great.
Thanks.
If a non-maven/gradle library is added to referencedLibraries config (added by #1196) - it is impossible to add the library's javadoc.
Environment
Steps To Reproduce
Current Result
Import a class and hover over it or ctrl+click on it. Only bare decompiler structure shows up without documentation.
Expected Result
Ability to map javadoc jars to libraries to allow for javadoc presentation on hover.