PT #157196600: Sys libs jandex index located at ~/.sts4-jandex/

This commit is contained in:
BoykoAlex
2018-05-04 10:23:16 -04:00
parent 15e3230e3b
commit a6d5e3c64f
10 changed files with 223 additions and 47 deletions

View File

@@ -13,7 +13,6 @@ package org.springframework.ide.vscode.boot.java.handlers;
import java.util.Collection;
import java.util.HashSet;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTVisitor;
@@ -268,7 +267,7 @@ public class BootJavaHoverProvider implements HoverHandler {
try {
IClasspath classpath = project.getClasspath();
if (classpath!=null) {
return IClasspathUtil.getBinaryRoots(classpath).stream().anyMatch(cpe -> {
return IClasspathUtil.getBinaryRoots(classpath, (cpe) -> !cpe.isSystem()).stream().anyMatch(cpe -> {
String name = cpe.getName();
return name.startsWith("spring-boot-actuator-");
});

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 Pivotal, Inc.
* Copyright (c) 2017, 2018 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
package org.springframework.ide.vscode.boot.java.handlers;
import java.io.File;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
@@ -127,7 +126,7 @@ public class BootJavaReferencesHandler implements ReferencesHandler {
private String[] getClasspathEntries(IDocument doc) throws Exception {
IJavaProject project = this.projectFinder.find(new TextDocumentIdentifier(doc.getUri())).get();
IClasspath classpath = project.getClasspath();
Stream<File> classpathEntries = IClasspathUtil.getBinaryRoots(classpath).stream();
Stream<File> classpathEntries = IClasspathUtil.getAllBinaryRoots(classpath).stream();
return classpathEntries
.filter(file -> file.exists())
.map(file -> file.getAbsolutePath())

View File

@@ -173,7 +173,7 @@ public final class CompilationUnitCache {
return new String[0];
} else {
IClasspath classpath = project.getClasspath();
Stream<File> classpathEntries = IClasspathUtil.getBinaryRoots(classpath).stream();
Stream<File> classpathEntries = IClasspathUtil.getAllBinaryRoots(classpath).stream();
return classpathEntries
.filter(file -> file.exists())
.map(file -> file.getAbsolutePath()).toArray(String[]::new);

View File

@@ -527,7 +527,7 @@ public class SpringIndexer {
private String[] getClasspathEntries(IJavaProject project) throws Exception {
IClasspath classpath = project.getClasspath();
Stream<File> classpathEntries = IClasspathUtil.getBinaryRoots(classpath).stream();
Stream<File> classpathEntries = IClasspathUtil.getAllBinaryRoots(classpath).stream();
return classpathEntries
.filter(file -> file.exists())
.map(file -> file.getAbsolutePath())

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016-2017 Pivotal, Inc.
* Copyright (c) 2016, 2018 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,7 +56,7 @@ public class PropertiesLoader {
public ConfigurationMetadataRepository load(IClasspath classPath) {
try {
IClasspathUtil.getBinaryRoots(classPath).forEach(fileEntry -> {
IClasspathUtil.getBinaryRoots(classPath, (cpe) -> !cpe.isSystem()).forEach(fileEntry -> {
if (fileEntry.exists()) {
if (fileEntry.isDirectory()) {
loadFromOutputFolder(fileEntry.toPath());