use of com.intellij.ide.SaveAndSyncHandlerImpl in project intellij-community by JetBrains.
the class DaemonRespondToChangesTest method testDaemonIgnoresFrameDeactivation.
public void testDaemonIgnoresFrameDeactivation() throws Throwable {
// return default value to avoid unnecessary save
DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(true);
String text = "class S { ArrayList<caret>XXX x;}";
configureByText(StdFileTypes.JAVA, text);
highlightErrors();
GeneralSettings settings = GeneralSettings.getInstance();
ApplicationEx application = ApplicationManagerEx.getApplicationEx();
boolean frameSave = settings.isSaveOnFrameDeactivation();
boolean appSave = application.isDoNotSave();
settings.setSaveOnFrameDeactivation(true);
application.doNotSave(false);
try {
SaveAndSyncHandlerImpl.doSaveDocumentsAndProjectsAndApp();
checkDaemonReaction(false, SaveAndSyncHandlerImpl::doSaveDocumentsAndProjectsAndApp);
} finally {
application.doNotSave(appSave);
settings.setSaveOnFrameDeactivation(frameSave);
}
}
Aggregations