Search in sources :

Example 1 with JandexIndex

use of org.springframework.ide.vscode.commons.jandex.JandexIndex in project sts4 by spring-projects.

the class GradleProjectClasspath method getBaseIndices.

@Override
protected JandexIndex[] getBaseIndices() {
    return new JandexIndex[] { new JandexIndex(getJreLibs().map(path -> path.toFile()).collect(Collectors.toList()), jarFile -> findIndexFile(jarFile), (classpathResource) -> {
        try {
            String javaVersion = getJavaRuntimeMinorVersion();
            if (javaVersion == null) {
                javaVersion = "8";
            }
            URL javadocUrl = new URL("https://docs.oracle.com/javase/" + javaVersion + "/docs/api/");
            return new HtmlJavadocProvider((type) -> SourceUrlProviderFromSourceContainer.JAVADOC_FOLDER_URL_SUPPLIER.sourceUrl(javadocUrl, type.getFullyQualifiedName()));
        } catch (MalformedURLException e) {
            Log.log(e);
            return null;
        }
    }) };
}
Also used : MalformedURLException(java.net.MalformedURLException) JandexIndex(org.springframework.ide.vscode.commons.jandex.JandexIndex) HtmlJavadocProvider(org.springframework.ide.vscode.commons.javadoc.HtmlJavadocProvider) URL(java.net.URL)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 JandexIndex (org.springframework.ide.vscode.commons.jandex.JandexIndex)1 HtmlJavadocProvider (org.springframework.ide.vscode.commons.javadoc.HtmlJavadocProvider)1