IDEA-145356 activity in a Scratch window triggers auto-refresh of tests
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 21 Sep 2015 11:32:28 +0000 (14:32 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 21 Sep 2015 11:32:28 +0000 (14:32 +0300)
platform/testRunner/src/com/intellij/execution/testframework/autotest/AutoTestManager.java

index bcd0388cb4bd250b03a76cb7162b9054c67dc651..e21f36f4d913b6fa3a375688ce760f55cb7e3b8c 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.execution.runners.ExecutionUtil;
 import com.intellij.execution.ui.RunContentDescriptor;
 import com.intellij.execution.ui.RunContentManager;
 import com.intellij.ide.DataManager;
+import com.intellij.ide.scratch.ScratchFileService;
 import com.intellij.ide.util.PropertiesComponent;
 import com.intellij.openapi.actionSystem.LangDataKeys;
 import com.intellij.openapi.application.ApplicationManager;
@@ -79,6 +80,9 @@ public class AutoTestManager {
     }, new Condition<VirtualFile>() {
       @Override
       public boolean value(VirtualFile file) {
+        if (ScratchFileService.getInstance().getRootType(file) != null) {
+          return false;
+        }
         // Vladimir.Krivosheev - I don't know, why AutoTestManager checks it, but old behavior is preserved
         return FileEditorManager.getInstance(myProject).isFileOpen(file);
       }