check for intention dumb-awareness before applying (EA-64965 - INRE: FileBasedIndexIm...
authorpeter <peter@jetbrains.com>
Wed, 18 Feb 2015 16:21:22 +0000 (17:21 +0100)
committerpeter <peter@jetbrains.com>
Wed, 18 Feb 2015 16:38:30 +0000 (17:38 +0100)
platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java

index 3e23137c8621347fc6dd8bf267c5cc8e076a753f..9b0f4f10720b9f5d16076db28584bfd86074f4ca 100644 (file)
@@ -246,6 +246,11 @@ class IntentionListStep implements ListPopupStep<IntentionActionWithTextCaching>
           @Override
           public void run() {
             if (myProject.isDisposed()) return;
+            if (DumbService.isDumb(myProject) && !DumbService.isDumbAware(cachedAction)) {
+              DumbService.getInstance(myProject).showDumbModeNotification(cachedAction.getText() + " is not available during indexing");
+              return;
+            }
+            
             PsiDocumentManager.getInstance(myProject).commitAllDocuments();
             final PsiFile file = PsiUtilBase.getPsiFileInEditor(myEditor, myProject);
             if (file == null) {