From 127a3aa4f2b4a76518530bd93ed43c49e9ec74b7 Mon Sep 17 00:00:00 2001 From: anstarovoyt Date: Mon, 22 Oct 2018 20:01:37 +0300 Subject: [PATCH] platform: ignore ast loading for current file "inspect all" can call inspections for file without loaded ast --- .../codeInsight/daemon/impl/LocalInspectionsPass.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java index 72dd105dd2b8..07a0267fa8d0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java @@ -253,13 +253,14 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass final List init = new ArrayList<>(); List>> entries = new ArrayList<>(toolToSpecifiedLanguageIds.entrySet()); + PsiFile file = session.getFile(); Processor>> processor = pair -> - AstLoadingFilter.disallowTreeLoading(() -> { + AstLoadingFilter.disallowTreeLoading(() -> AstLoadingFilter.forceAllowTreeLoading(file, () -> { LocalInspectionToolWrapper toolWrapper = pair.getKey(); Set 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;