diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
commit | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (patch) | |
tree | fc0dcd722b6d445468dbe7dad13b4c11781b1cbe /platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java | |
parent | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff) | |
download | idea-c3d3a90f6b4ead083d63e28e6b9fcea93d675678.tar.gz |
Snapshot idea/138.1980 from git://git.jetbrains.org/idea/community.git
Change-Id: Ib567c9c152d770212a7a3db20fbf591c210920bd
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java')
-rw-r--r-- | platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java index d8fd3ab40508..4ac5e686c5bc 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java @@ -709,11 +709,20 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements JDOM return new Runnable() { @Override public void run() { - if (myDisposed || !myProject.isInitialized()) return; - if (PowerSaveMode.isEnabled()) return; - Editor activeEditor = FileEditorManager.getInstance(myProject).getSelectedTextEditor(); + ApplicationManager.getApplication().assertIsDispatchThread(); + if (myDisposed || !myProject.isInitialized() || PowerSaveMode.isEnabled()) { + return; + } + if (HeavyProcessLatch.INSTANCE.isRunning()) { + if (myAlarm.isEmpty()) { + myAlarm.addRequest(myUpdateRunnable, mySettings.AUTOREPARSE_DELAY); + } + return; + } + Editor activeEditor = FileEditorManager.getInstance(myProject).getSelectedTextEditor(); final PsiDocumentManagerImpl documentManager = (PsiDocumentManagerImpl)PsiDocumentManager.getInstance(myProject); + Runnable runnable = new Runnable() { @Override public void run() { @@ -728,7 +737,6 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements JDOM final Collection<FileEditor> activeEditors = getSelectedEditors(); if (activeEditors.isEmpty()) return; - ApplicationManager.getApplication().assertIsDispatchThread(); if (ApplicationManager.getApplication().isWriteAccessAllowed()) { // makes no sense to start from within write action, will cancel anyway // we'll restart when write action finish |