I want to import the JavaFX docs to VSCode so that it displays the docs in tooltips like with other methods. The link to JavaFX docs is- https://openjfx.io/javadoc/15/ But I don't know how to add it the VSCode
Asked
Active
Viewed 1,074 times
2 Answers
0
Do you mean that you want to get JavaFX docs like this:
You can achieve this by inserting new snippets:
Press
Ctrl+Shift+P
to open Command Palette and selectPreference: Configure User Snippets
, then chooseNew Global Snippets file
;Enter snippet name and there will be a file opened, add the following code to it:
"JavaFX": { "prefix": "javafx-doc", "body": [ "https://docs.oracle.com/javafx/2/api/index.html" ], "description": "javaFX Doc" }
When you type the prefix
javafx-doc
in .java file, this will show as snippets.
More detailed information about Snippets, you can refer to Creating own Snippets in VS Code. If there's any misunderstanding about your question, please let me know.

Molly Wang-MSFT
- 7,943
- 2
- 9
- 22
-
1I am not trying to create snippets but I want the actual documentation to be visible for methods and classes like the documentation for printf() is visible in the image – Nishesh Garg Oct 30 '20 at 07:29
-
So you want when you type func(), which we assume it's a function in the javafx-docs, then there will be the related information displayed in the block? – Molly Wang-MSFT Oct 30 '20 at 07:58
-
Yes, that's exactly what I am trying to do. I can do this in eclipse but I don't know how to do it in VSCode – Nishesh Garg Oct 30 '20 at 11:24
-
The docs which can be shown in eclipse is provided by the JDK you installed and not the official link. If the JDK in Eclipse is the same one in VS Code, call a function at will, then Ctrl+Click to see if there's description before class, if there is, the extension Language Support for Java(TM) by Red Hat will get them displayed in the block. if there're no detailed information there, there won't docs displayed. So this question may be solved by installing a jdk with docs in jar. – Molly Wang-MSFT Nov 02 '20 at 03:03
0
I found an indirect way to do this. We can add the documentation path to the .classpath file of the project. We have to do it manually as there is no way to do this automatically yet.
<classpath>
<classpathentry kind="lib" path="lib/javafx.base.jar">
<attributes>
<attribute name="javadoc_location" value="https://docs.oracle.com/javafx/2/api/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/javafx.controls.jar">
<attributes>
<attribute name="javadoc_location" value="https://docs.oracle.com/javafx/2/api/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/javafx.fxml.jar">
<attributes>
<attribute name="javadoc_location" value="https://docs.oracle.com/javafx/2/api/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/jfoenix-9.0.10.jar">
<attributes>
<attribute name="javadoc_location" value="https://javadoc.io/static/com.jfoenix/jfoenix/9.0.10/"/>
</attributes>
</classpathentry>
</classpath>

Nishesh Garg
- 11
- 1
- 5