Skip to content

Commit 9f123e9

Browse files
gluxonrgrunber
authored andcommitted
Use java.import.exclusions config when determining trigger files
1 parent c7cfca4 commit 9f123e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/extension.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,15 +918,18 @@ async function getTriggerFiles(): Promise<string[]> {
918918
}
919919
}
920920

921-
const javaFilesUnderRoot: Uri[] = await workspace.findFiles(new RelativePattern(rootFolder, "*.java"), undefined, 1);
921+
// Paths set by 'java.import.exclusions' will be ignored when searching trigger files.
922+
const exclusionGlob = getExclusionBlob();
923+
924+
const javaFilesUnderRoot: Uri[] = await workspace.findFiles(new RelativePattern(rootFolder, "*.java"), exclusionGlob, 1);
922925
for (const javaFile of javaFilesUnderRoot) {
923926
if (isPrefix(rootPath, javaFile.fsPath)) {
924927
openedJavaFiles.push(javaFile.toString());
925928
return;
926929
}
927930
}
928931

929-
const javaFilesInCommonPlaces: Uri[] = await workspace.findFiles(new RelativePattern(rootFolder, "{src, test}/**/*.java"), undefined, 1);
932+
const javaFilesInCommonPlaces: Uri[] = await workspace.findFiles(new RelativePattern(rootFolder, "{src, test}/**/*.java"), exclusionGlob, 1);
930933
for (const javaFile of javaFilesInCommonPlaces) {
931934
if (isPrefix(rootPath, javaFile.fsPath)) {
932935
openedJavaFiles.push(javaFile.toString());

0 commit comments

Comments
 (0)