9

In my Mac OS 10.14 I have VS Code 1.47.3 and yesterday installed Java Extension Pack 0.9.1. I am able to run Java project (Maven) but I do not see any javadoc on hover feature. For example when mouse pointer is hovering on ds.show() (line 29) in screenshot, I expect to see hover pane showing docs on show method like it shows in same eclipse project. I have JDK8 and OpenJDK14 installed on my system.

Here is the screenshot:

enter image description here

Below is not important: Also how to disable annoying logs in Terminal window when I am editing file? These logs look like:

3a6e249d Publish Diagnostics [Done]
6dcf0221 Building [Done]
ebb16695 Building [Done]
0e4416a3 Validate documents [Done]

As can be seen in screenshot.

ace
  • 11,526
  • 39
  • 113
  • 193

2 Answers2

1

If you are still stuck, I found a way, just try enabling 'Intellisense' in your red hat java extension. This may work for you. And for those logs, looks like your are running your application in debug mode. Your can't disable them if that's the case.

EDIT (The actual solution):

Javafx java docs in vs code
To achieve the above results, follow bellow steps.

  1. Go to User/Workspace settings.
  2. Hit ctrl f and type java.project.referencedLibraries.
  3. Click edit in settings.json.
  4. Paste the following setting.
"java.project.referencedLibraries": {
    "include": [
        "lib/**/*.jar",
        "%PATH_TO_FX%/lib/*.jar"
    ],
    "sources": {
        "%PATH_TO_FX%/lib/javafx.base.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.controls.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.fxml.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.graphics.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.media.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.swing.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.web.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.swt.jar": "%PATH_TO_FX%/src.zip"
    }
}

Here %PATH_TO_Fx% is the path to the javafx folder or javafx env variable. Be sure if you are linux/mac user type it like $PATH_TO_FX. To set enviorment vairable for javafx refer the getting started section of openjfx.org

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 17 '21 at 16:09
-3

Try viewing it with an Keyboard-Shortcut, to see if the documentation is availible or if your IntelliJ has pathing issues:

The Command for this is editor.action.showHover command. Default it's mapped to cmd+k -> cmd+i, I think.

Another problem which happens often with my JS environment is that i have to select the call (In your case ds.show()) and then hover over it, while selected.

Screenshot, showing selection based hover

finncyr
  • 65
  • 4