Skip to content
Advertisement

How to show Javadoc of a imported library when hovering on its methods and classes?

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(?)

Link for JSFML here if it helps:

Advertisement

Answer

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: enter image description here

However, RenderWindow.class doesn’t have this kind of comments, so java extension will only show its package structure: enter image description here

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.

Advertisement