You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often want to view the Javadoc in the browser for easier reading, or to read package/module documentation (which afaik isn't easily viewable somehow inside VS Code).
Environment
Operating System: Windows 10
JDK version: 13.0.1
Visual Studio Code version: 1.41.1
Java extension version: 0.55.1
Steps To Reproduce
option 1:
hover over an element
option 2:
trigger autocompletion for an elemention
Current Result
option 1:
option 2:
Expected Result
I'd like for the pop-up dialogs to have an icon which opens the Javadoc of the element in the default browser. I'd already be very happy if this would work for just JDK classes, but ideally this would also work for Maven dependencies.
Reacted by Royg Garcia, marchign, Tim Osborn, Manoj Baishya, firehooper, Christoph Pirkl, Peter Haumer, Olivier Cailloux, goyalyashpal, Nithin M.K. and 2 more
So I would like something similar in VS Code. And neither VS Code nor Java LS would need to render anything themselves: the JDK Javadocs are available online, and the Javadocs for Maven artifacts are (almost) always provided alongside the binary JARs.
Note, as a workaround, that one can apparently open the javadoc from Firefox using the JAR file. For example, browsing to jar:file:///home/myusername/.m2/repository/com/google/guava/guava/32.0.1-jre/guava-32.0.1-jre-javadoc.jar!/index.html opens the doc, for me.
If there is general browser support for the jar:file protocol, this provides a solution for VSCode with no need of web server. Otherwise, perhaps at least it can provide this option if it detects that Firefox is installed?
Side note: Recent VS Code versions also have an integrated browser (can open it with F1 > Browser: Open Integrated Browser) which seems to work ok for viewing Javadoc (at least the standard JDK 25 one). Maybe that could be an option as well?
Unfortunately it seems there is no first-class API for extensions yet to open links in the integrated browser, see microsoft/vscode#311064.
Activity
akaroml commentedon Feb 17, 2020
I agree that a separate window is more efficient to read the docs.
The doc is generated by JDT and rendered by VS Code. For this to happen, we have the following options:
I don't' see a straight answer here.
anthonyvdotbe commentedon Feb 19, 2020
In NetBeans, option 2 is used. Using the same method as above, I get:
where clicking the red-circled icon opens the method's documentation in the browser.
For JDK classes, as in this example, it uses the official Javadoc, e.g. in this case https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/Objects.html#requireNonNull%28T%29
For Maven dependencies, it uses a simple webserver that relies on the Javadoc JARs from the local Maven repository, e.g. for a Guava method: http://127.0.0.1:8082/resource/jar%3Afile%3A/D%3A/Maven%2520repository/com/google/guava/guava/28.2-jre/guava-28.2-jre-javadoc.jar%21/com/google/common/base/Preconditions.html#checkNotNull%28T%29
So I would like something similar in VS Code. And neither VS Code nor Java LS would need to render anything themselves: the JDK Javadocs are available online, and the Javadocs for Maven artifacts are (almost) always provided alongside the binary JARs.
manojbaishya commentedon May 31, 2021
There is an extension now, Docs View, that displays in a separate panel.
oliviercailloux commentedon Oct 16, 2023
Note, as a workaround, that one can apparently open the javadoc from Firefox using the JAR file. For example, browsing to
jar:file:///home/myusername/.m2/repository/com/google/guava/guava/32.0.1-jre/guava-32.0.1-jre-javadoc.jar!/index.htmlopens the doc, for me.If there is general browser support for the
jar:fileprotocol, this provides a solution for VSCode with no need of web server. Otherwise, perhaps at least it can provide this option if it detects that Firefox is installed?Marcono1234 commentedon Jul 30, 2026
Side note: Recent VS Code versions also have an integrated browser (can open it with F1
> Browser: Open Integrated Browser) which seems to work ok for viewing Javadoc (at least the standard JDK 25 one). Maybe that could be an option as well?Unfortunately it seems there is no first-class API for extensions yet to open links in the integrated browser, see microsoft/vscode#311064.