From 5a15a3e160a46c58f294e8d2b4598f57775bc88e Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Oct 2016 20:31:02 +0200 Subject: [PATCH] no collectIntentionsFromDoNotShowLeveledInspections in dumb mode, as inspections are not run during indexing --- .../codeInsight/daemon/impl/ShowIntentionsPass.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java index 9d37e63bc177..3a6c1b94ece7 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java @@ -358,9 +358,9 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { } /** - * Invoked in EDT, each inspection should be fast + * Can be invoked in EDT, each inspection should be fast */ - private static void collectIntentionsFromDoNotShowLeveledInspections(final Project project, + private static void collectIntentionsFromDoNotShowLeveledInspections(@NotNull final Project project, @NotNull final PsiFile hostFile, PsiElement psiElement, final int offset, @@ -374,6 +374,10 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { " in:" + psiElement.getContainingFile() + " host:" + hostFile + "(" + hostFile.getClass().getName() + ")", new Attachment(virtualFile != null ? virtualFile.getPresentableUrl() : "null", text != null ? text : "null")); } + if (DumbService.isDumb(project)) { + return; + } + final List intentionTools = new ArrayList<>(); final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile(); final InspectionToolWrapper[] tools = profile.getInspectionTools(hostFile);