As described in the title. We were currently using JSFML and Swing to develop a project, where I would like to view the Javadoc of JSFML in VSCode. However, when I tried to hover to show Javadoc it doesn't but throws me only a simple line.
For example: I built a renderWindow
by using one of JSFML's package, graphic (with class RenderWindow
), and try to hover. It shows me this:
org.jsfml.graphics.RenderWindow.RenderWindow(VideoMode arg0, String arg1)
Instead of Javadoc of it. When I went into the definition, instead of Javadoc I saw such a comment at the head of its class file:
// Failed to get sources. Instead, stub sources have been generated by the disassembler.
// Implementation of methods is unavailable.
How can I see the Javadoc of it in VSCode? Or I actually was not allowed to since it's restricted(?)
That's because the jar package which is downloaded from official website doesn't include the description.
Like you can see, when we hover over the function println
and ctrl+click to see its class, the docstrings and parameter information are from the comments in class:
However, RenderWindow.class
doesn't have this kind of comments, so java extension will only show its package structure:
It's not related to VS Code or Java extension but the jsfml.jar
itself, you can view JSFML javadoc to get more detailed information.
Molly's answer explains why the javadoc is not available for your JAR.
If JSFML or any other Java dependency you use has a source jar, VS Code can use it so you can see the source and its Javadoc just like the JDK. The steps to get it visible in VS Code are:
org.jsfml.graphics.RenderWindow.RenderWindow
)Failed to get sources. Instead, stub sources have been generated by the disassembler...
Failed to get sources. Instead, stub sources have been generated by the disassembler...
, right/alt click to open the context menu and select Attach Source . This solution was originally proposed in https://github.com/redhat-developer/vscode-java/issues/1855#issuecomment-823142835 on a similar issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.