'Java shortcut in VSCode to open JavaDocs

In Intellij the shortcut for showing official Javadoc is CTRL+q. Any shortcut to do this in VSCode?



Solution 1:[1]

to view the Java documentation in Visual Studio Code to you can do it by the following ways:

  1. mouse hover elements which you want to lookup
  2. after short version appears, press ctrl key twice (if you press ctrl key once, the long version documentation appears as long as you hold the ctrl key)

NOTE: if it didn't work you need to install the java extension path in your visual studio code which the extension id is: @id:vscjava.vscode-java-pack

visual studio code with Java code and related Java extension

Solution 2:[2]

VS Code have such capability but you may need to set a keyboard shortcut first. First go to the configure page:

enter image description here

Search Show Definition Preview Hover, you will see it, and just set a shortcut whatever you want:

enter image description here

Solution 3:[3]

If you would like to view documentation in a separate panel, there is an extension called Docs View. Simply set shortcuts for docsView.documentation.focus and workbench.action.togglePanel, position the cursor over the class, attribute or method and press the shortcut. Other useful commands are editor.action.showHover and editor.action.showDefinitionPreviewHover.

docs-view-preview

Solution 4:[4]

There is an extension calls

Docs View which show you the docs in separate vs code window

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Sheng Chen
Solution 3 Manoj Baishya
Solution 4 arik