"Configure Python Interpreter" doesn't need write action
authorpeter <peter@jetbrains.com>
Wed, 16 Nov 2016 17:51:02 +0000 (18:51 +0100)
committerpeter <peter@jetbrains.com>
Wed, 16 Nov 2016 17:53:01 +0000 (18:53 +0100)
python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyInterpreterInspection.java

index 5d8d2458c9db24f0d346e62f9df0f9931dab9aa5..5f14689e62683dd08c15e90e055ce509b913a31f 100644 (file)
@@ -19,7 +19,6 @@ import com.intellij.codeInspection.LocalInspectionToolSession;
 import com.intellij.codeInspection.LocalQuickFix;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.ProblemsHolder;
-import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleUtilCore;
 import com.intellij.openapi.options.ShowSettingsUtil;
@@ -113,12 +112,14 @@ public class PyStudyInterpreterInspection extends PyInspection {
       return "Configure Python Interpreter";
     }
 
+    @Override
+    public boolean startInWriteAction() {
+      return false;
+    }
+
     @Override
     public void applyFix(@NotNull final Project project, @NotNull ProblemDescriptor descriptor) {
-      ApplicationManager.getApplication().invokeLater(() -> {
-        // outside of read action
-        ShowSettingsUtil.getInstance().showSettingsDialog(project, "Project Interpreter");
-      });
+      ShowSettingsUtil.getInstance().showSettingsDialog(project, "Project Interpreter");
     }
   }
 }