DaemonRespondToChangesTest fixes; really ignore action of IgnoreDocumentRunnable class

This commit is contained in:
Alexey Kudravtsev
2015-02-09 14:47:16 +03:00
parent b7d0bbdecd
commit 8fffa312a1
3 changed files with 5 additions and 10 deletions
@@ -42,7 +42,6 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.RangeMarker;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.ex.RangeHighlighterEx;
import com.intellij.openapi.editor.impl.DocumentMarkupModel;
import com.intellij.openapi.editor.markup.MarkupModel;
@@ -125,7 +124,6 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers
@NotNull DaemonCodeAnalyzerSettings daemonCodeAnalyzerSettings,
@NotNull EditorTracker editorTracker,
@NotNull PsiDocumentManager psiDocumentManager,
@NotNull EditorColorsManager colorsManager,
@SuppressWarnings("UnusedParameters") @NotNull final NamedScopeManager namedScopeManager,
@SuppressWarnings("UnusedParameters") @NotNull final DependencyValidationManager dependencyValidationManager) {
myProject = project;
@@ -305,7 +303,6 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers
UIUtil.dispatchAllInvocationEvents();
Project project = file.getProject();
setUpdateByTimerEnabled(false);
FileStatusMap.getAndClearLog();
FileStatusMap fileStatusMap = getFileStatusMap();
fileStatusMap.allowDirt(canChangeDocument);
@@ -367,9 +364,6 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers
@TestOnly
public void prepareForTest() {
//if (!myInitialized) {
// projectOpened();
//}
setUpdateByTimerEnabled(false);
waitForTermination();
}
@@ -363,6 +363,7 @@ public class DaemonListeners implements Disposable {
static boolean isUnderIgnoredAction(@Nullable Object action) {
return action instanceof DocumentRunnable.IgnoreDocumentRunnable ||
action == DocumentRunnable.IgnoreDocumentRunnable.class ||
ApplicationManager.getApplication().hasWriteAction(DocumentRunnable.IgnoreDocumentRunnable.class);
}
@@ -428,15 +429,13 @@ public class DaemonListeners implements Disposable {
@Override
public void beforeWriteActionStart(Object action) {
myDaemonWasRunning = myDaemonCodeAnalyzer.isRunning();
if (!myDaemonWasRunning) return; // we'll restart in writeActionFinished()
if (!myDaemonWasRunning || isUnderIgnoredAction(action)) return; // we'll restart in writeActionFinished()
stopDaemon(true, "Write action start");
}
@Override
public void writeActionFinished(Object action) {
if (myDaemonWasRunning) {
stopDaemon(true, "Write action finish");
}
stopDaemon(true, "Write action finish");
}
}
@@ -1631,6 +1631,8 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
return infos;
}
catch (ProcessCanceledException e) {
PsiDocumentManager.getInstance(project).commitAllDocuments();
UIUtil.dispatchAllInvocationEvents();
exception = e;
}
}