Skip to content

Commit

Permalink
GH-1119: do not invoke reconcile operation when only computing docume…
Browse files Browse the repository at this point in the history
…nt symbols
  • Loading branch information
martinlippert committed Oct 20, 2023
1 parent 2977081 commit 31e3667
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public void accept(String docURI, Diagnostic diagnostic) {
SpringIndexerJavaContext context = new SpringIndexerJavaContext(project, cu, docURI, file,
lastModified, docRef, content, generatedSymbols, generatedBeans, problemCollector, SCAN_PASS.ONE, new ArrayList<>(), !ignoreMethodBodies);

scanAST(context);
scanAST(context, true);

IndexCacheKey symbolCacheKey = getCacheKey(project, SYMBOL_KEY);
IndexCacheKey beansCacheKey = getCacheKey(project, BEANS_KEY);
Expand Down Expand Up @@ -350,7 +350,7 @@ public void accept(ReconcileProblem problem) {
SpringIndexerJavaContext context = new SpringIndexerJavaContext(project, cu, docURI, file,
0, docRef, content, generatedSymbols, generatedBeans, voidProblemCollector, SCAN_PASS.ONE, new ArrayList<>(), true);

scanAST(context);
scanAST(context, false);

return generatedSymbols.stream().map(s -> s.getEnhancedSymbol()).collect(Collectors.toList());
});
Expand Down Expand Up @@ -408,7 +408,7 @@ public void acceptAST(String sourceFilePath, CompilationUnit cu) {
SpringIndexerJavaContext context = new SpringIndexerJavaContext(project, cu, docURI, sourceFilePath,
lastModified, docRef, null, generatedSymbols, generatedBeans, problemCollector, SCAN_PASS.ONE, new ArrayList<>(), !ignoreMethodBodies);

scanAST(context);
scanAST(context, true);

dependencies.putAll(sourceFilePath, context.getDependencies());
scannedTypes.addAll(context.getScannedTypes());
Expand Down Expand Up @@ -559,7 +559,7 @@ public void acceptAST(String sourceFilePath, CompilationUnit cu) {
SpringIndexerJavaContext context = new SpringIndexerJavaContext(project, cu, docURI, sourceFilePath,
lastModified, docRef, null, generatedSymbols, generatedBeans, problemCollector, pass, nextPassFiles, !ignoreMethodBodies);

scanAST(context);
scanAST(context, true);
progressTask.increment();
}
};
Expand All @@ -584,7 +584,7 @@ private void addEmptyDiagnostics(Map<String, List<Diagnostic>> diagnosticsByDoc,
}
}

private void scanAST(final SpringIndexerJavaContext context) {
private void scanAST(final SpringIndexerJavaContext context, boolean includeReconcile) {
context.getCu().accept(new ASTVisitor() {

@Override
Expand Down Expand Up @@ -647,8 +647,9 @@ public boolean visit(MarkerAnnotation node) {
}
});


reconcile(context);
if (includeReconcile) {
reconcile(context);
}

dependencyTracker.update(context.getFile(), context.getDependencies());;
}
Expand Down

0 comments on commit 31e3667

Please sign in to comment.