Skip to content

Commit

Permalink
GH-1124: do not run indexing and cache write for empty list of affect…
Browse files Browse the repository at this point in the history
…ed files
  • Loading branch information
martinlippert committed Oct 15, 2023
1 parent 6f7f9fd commit 99032f1
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,18 +457,20 @@ private void scanAffectedFiles(IJavaProject project, Set<String> changedTypes, S
}
}

DocumentDescriptor[] docsToScan = filesToScan.stream().map(file -> {
File realFile = new File(file);
String docURI = UriUtil.toUri(realFile).toASCIIString();
long lastModified = realFile.lastModified();
return new DocumentDescriptor(docURI, lastModified);
}).toArray(DocumentDescriptor[]::new);

for (DocumentDescriptor docToScan : docsToScan) {
this.symbolHandler.removeSymbols(project, docToScan.getDocURI());
if (!filesToScan.isEmpty()) {
DocumentDescriptor[] docsToScan = filesToScan.stream().map(file -> {
File realFile = new File(file);
String docURI = UriUtil.toUri(realFile).toASCIIString();
long lastModified = realFile.lastModified();
return new DocumentDescriptor(docURI, lastModified);
}).toArray(DocumentDescriptor[]::new);

for (DocumentDescriptor docToScan : docsToScan) {
this.symbolHandler.removeSymbols(project, docToScan.getDocURI());
}

scanFilesInternally(project, docsToScan);
}

scanFilesInternally(project, docsToScan);

log.info("Finished scanning affected files {}", alreadyScannedFiles);
}
Expand Down

0 comments on commit 99032f1

Please sign in to comment.