hide non-dumb-aware intentions (EA-65004 - INRE: FileBasedIndexImpl.handleDumbMode)
[idea/community.git] / platform / lang-impl / src / com / intellij / codeInsight / intention / impl / IntentionActionWithTextCaching.java
index 2c5b5b3ad8c64f049f34cde17ff44e37bc6110e2..303d002458df0524e462f234ed057e8c22f83b76 100644 (file)
@@ -18,6 +18,8 @@ package com.intellij.codeInsight.intention.impl;
 
 import com.intellij.codeInsight.daemon.impl.HighlightInfo;
 import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.project.PossiblyDumbAware;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.diagnostic.Logger;
 import org.jetbrains.annotations.NotNull;
@@ -29,7 +31,7 @@ import java.util.ArrayList;
 /**
 * @author cdr
 */
-class IntentionActionWithTextCaching implements Comparable<IntentionActionWithTextCaching> {
+class IntentionActionWithTextCaching implements Comparable<IntentionActionWithTextCaching>, PossiblyDumbAware {
   private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching");
   private final List<IntentionAction> myOptionIntentions = new ArrayList<IntentionAction>();
   private final List<IntentionAction> myOptionErrorFixes = new ArrayList<IntentionAction>();
@@ -109,4 +111,9 @@ class IntentionActionWithTextCaching implements Comparable<IntentionActionWithTe
   public Icon getIcon() {
     return myIcon;
   }
+
+  @Override
+  public boolean isDumbAware() {
+    return DumbService.isDumbAware(myAction);
+  }
 }