honor FileEditorProvider's dumb-awareness
authorpeter <peter@jetbrains.com>
Fri, 6 Feb 2015 12:26:05 +0000 (13:26 +0100)
committerpeter <peter@jetbrains.com>
Fri, 6 Feb 2015 15:11:10 +0000 (16:11 +0100)
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorProviderManagerImpl.java

index 3fb69a7f50895bf887fbf9350922d03e7aace87f..aba649be711526eb9c5a6eca7c742cedee4fa9d6 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.fileEditor.FileEditorProvider;
 import com.intellij.openapi.fileEditor.WeighedFileEditorProvider;
 import com.intellij.openapi.fileEditor.ex.FileEditorProviderManager;
 import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
+import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Computable;
 import com.intellij.openapi.util.Condition;
@@ -86,6 +87,9 @@ public final class FileEditorProviderManagerImpl extends FileEditorProviderManag
       if (ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
         @Override
         public Boolean compute() {
+          if (DumbService.isDumb(project) && !DumbService.isDumbAware(provider)) {
+            return false;
+          }
           return provider.accept(project, file);
         }
       })) {