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 8e5faff1165a..ae9df3036253 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 @@ -66,6 +66,7 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; /** * This class also controls the auto-reparse and auto-hints. @@ -104,7 +105,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx private StatusBarUpdater myStatusBarUpdater; private final PassExecutorService myPassExecutorService; private static final Key> HIGHLIGHTS_TO_REMOVE_KEY = Key.create("HIGHLIGHTS_TO_REMOVE"); - + private final AtomicInteger myModificationCount = new AtomicInteger(); public DaemonCodeAnalyzerImpl(Project project, DaemonCodeAnalyzerSettings daemonCodeAnalyzerSettings, EditorTracker editorTracker) { myProject = project; @@ -338,9 +339,8 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx return myFileStatusMap; } - @TestOnly - public synchronized ProgressIndicator getUpdateProgress() { - return myUpdateProgress; + public int getModificationCount() { + return myModificationCount.get(); } public synchronized boolean isRunning() { @@ -358,6 +358,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx private synchronized void cancelUpdateProgress(final boolean start, @NonNls String reason) { PassExecutorService.log(myUpdateProgress, null, reason, start); + myModificationCount.incrementAndGet(); if (myUpdateProgress != null) { myUpdateProgress.cancel();