mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
platform: ignore ast loading for current file
"inspect all" can call inspections for file without loaded ast
This commit is contained in:
+3
-2
@@ -253,13 +253,14 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
final List<InspectionContext> init = new ArrayList<>();
|
||||
List<Map.Entry<LocalInspectionToolWrapper, Set<String>>> entries = new ArrayList<>(toolToSpecifiedLanguageIds.entrySet());
|
||||
|
||||
PsiFile file = session.getFile();
|
||||
Processor<Map.Entry<LocalInspectionToolWrapper, Set<String>>> processor = pair ->
|
||||
AstLoadingFilter.disallowTreeLoading(() -> {
|
||||
AstLoadingFilter.disallowTreeLoading(() -> AstLoadingFilter.<Boolean, RuntimeException>forceAllowTreeLoading(file, () -> {
|
||||
LocalInspectionToolWrapper toolWrapper = pair.getKey();
|
||||
Set<String> dialectIdsSpecifiedForTool = pair.getValue();
|
||||
runToolOnElements(toolWrapper, dialectIdsSpecifiedForTool, iManager, isOnTheFly, indicator, elements, session, init, elementDialectIds);
|
||||
return true;
|
||||
});
|
||||
}));
|
||||
boolean result = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(entries, indicator, processor);
|
||||
if (!result) throw new ProcessCanceledException();
|
||||
return init;
|
||||
|
||||
Reference in New Issue
Block a user