Home > OS >  Attach external javadoc to vscode
Attach external javadoc to vscode

Time:03-22

Is there a way to attach an external javadoc in vscode using a link to it? For example, intellij idea allows you to do this.

CodePudding user response:

If your Javadoc .jar file is inside your project directory you can add this to your classpath. Just rename everything to fit your needs.

<classpathentry kind="lib" path="lib/avro-1.8.2.jar">
     <attributes>
            <attribute name="javadoc_location" value="jar:platform:/resources/project/doc/avro-1.8.2-javadoc.jar!/" />
     </attributes>
</classpathentry>

CodePudding user response:

You can try the following methods:


For example, I have a project:

/project
/lib
  test-1.0.0.jar
/doc
  test-1.0.0-javadoc.jar

Add your .classPath:

<classpathentry kind="lib" path="lib/test-1.0.0.jar">
  <attributes>
    <attribute name="javadoc_location" value="jar:platform:/resource/project/doc/test-1.0.0-javadoc.jar!/" />
  </attributes>
</classpathentry>

CodePudding user response:

Library, source and javadoc location

The Classpath.fileReference(Object) 20 method was added to the public API to be able to set custom source and javadoc location for a classpath entry.

import org.gradle.plugins.ide.eclipse.model.Library

apply plugin: 'java'
apply plugin: 'eclipse'

eclipse {
    classpath {
        file {
            whenMerged { 
                def lib = entries.find { it.path.contains 'my-commercial-lib.jar'
            }
            lib.javadocPath = fileReference(file('libs/my-commercial-lib-javadoc.jar'))
            lib.sourcePath = fileReference(file('libs/m-commercial-lib-source.jar'))
        }
    }
}


[details=Configured entry in classpath container]


[/details]
  • Related