check for sudden dumb mode in on-the-fly import (IDEA-154934)

This commit is contained in:
peter
2016-04-19 14:41:23 +02:00
parent 4e5b9e0f5e
commit 2de95dae36
2 changed files with 5 additions and 4 deletions
@@ -25,6 +25,7 @@ import com.intellij.openapi.editor.ex.MarkupModelEx;
import com.intellij.openapi.editor.impl.DocumentMarkupModel;
import com.intellij.openapi.editor.impl.EditorMarkupModelImpl;
import com.intellij.openapi.editor.markup.MarkupModel;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ProperTextRange;
import com.intellij.openapi.util.TextRange;
@@ -67,8 +68,10 @@ public class DefaultHighlightInfoProcessor extends HighlightInfoProcessor {
}
if (editor != null && !editor.isDisposed()) {
// usability: show auto import popup as soon as possible
new ShowAutoImportPass(project, psiFile, editor).addImports();
if (!DumbService.isDumb(project)) {
new ShowAutoImportPass(project, psiFile, editor).addImports();
}
DaemonListeners.repaintErrorStripeRenderer(editor, project);
}
}
@@ -78,8 +78,6 @@ public class ShowAutoImportPass extends TextEditorHighlightingPass {
}
public void addImports() {
if (!isValid()) return;
Application application = ApplicationManager.getApplication();
application.assertIsDispatchThread();
if (!application.isUnitTestMode() && !myEditor.getContentComponent().hasFocus()) return;