do not index package-info.java files
Fixes GH-1426
This commit is contained in:
@@ -90,9 +90,9 @@ public class SpringFactoriesIndexer implements SpringIndexer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterestedIn(String docURI) {
|
||||
if (docURI.endsWith(".factories")) {
|
||||
Path path = Paths.get(URI.create(docURI));
|
||||
public boolean isInterestedIn(String resource) {
|
||||
if (resource.endsWith(".factories")) {
|
||||
Path path = Paths.get(URI.create(resource));
|
||||
return FILE_GLOB_PATTERN.matches(path);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2019, 2022 Pivotal, Inc.
|
||||
* Copyright (c) 2019, 2024 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
|
||||
@@ -21,7 +21,7 @@ import org.springframework.ide.vscode.commons.java.IJavaProject;
|
||||
public interface SpringIndexer {
|
||||
|
||||
String[] getFileWatchPatterns();
|
||||
boolean isInterestedIn(String docURI);
|
||||
boolean isInterestedIn(String resource); // note that this might be a document URI or a standard file path on the system
|
||||
|
||||
List<EnhancedSymbolInformation> computeSymbols(IJavaProject project, String docURI, String content) throws Exception;
|
||||
|
||||
|
||||
@@ -148,8 +148,8 @@ public class SpringIndexerJava implements SpringIndexer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterestedIn(String docURI) {
|
||||
return docURI.endsWith(".java");
|
||||
public boolean isInterestedIn(String resource) {
|
||||
return resource.endsWith(".java") && !resource.endsWith("package-info.java");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -841,7 +841,7 @@ public class SpringIndexerJava implements SpringIndexer {
|
||||
return Stream.empty();
|
||||
}
|
||||
})
|
||||
.filter(path -> path.getFileName().toString().endsWith(".java"))
|
||||
.filter(path -> isInterestedIn(path.getFileName().toString()))
|
||||
.filter(Files::isRegularFile)
|
||||
.map(path -> path.toAbsolutePath().toString())
|
||||
.toArray(String[]::new);
|
||||
|
||||
@@ -105,8 +105,8 @@ public class SpringIndexerXML implements SpringIndexer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterestedIn(String docURI) {
|
||||
return docURI.endsWith(".xml");
|
||||
public boolean isInterestedIn(String resource) {
|
||||
return resource.endsWith(".xml");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
@org.springframework.lang.NonNullApi
|
||||
package org.test;
|
||||
Reference in New Issue
Block a user