mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
python: write action is unnecessary in some quick fixes
This commit is contained in:
@@ -48,6 +48,11 @@ public class AddIgnoredRoleFix implements LocalQuickFix, LowPriorityAction {
|
||||
return "Ignore undefined role";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
if (!myInspection.ignoredRoles.contains(myRole)) {
|
||||
|
||||
@@ -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;
|
||||
@@ -87,12 +86,14 @@ public class PyInterpreterInspection 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,6 +272,11 @@ public class PyPackageRequirementsInspection extends PyInspection {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull final Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
boolean installManagement = false;
|
||||
@@ -356,6 +361,11 @@ public class PyPackageRequirementsInspection extends PyInspection {
|
||||
return "Install and import package " + myPackageName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
|
||||
final PyPackageManagerUI ui = new PyPackageManagerUI(project, mySdk, new UIListener(myModule) {
|
||||
@@ -411,6 +421,11 @@ public class PyPackageRequirementsInspection extends PyInspection {
|
||||
return String.format("Ignore requirement%s", plural ? "s" : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
final PsiElement element = descriptor.getPsiElement();
|
||||
@@ -444,6 +459,11 @@ public class PyPackageRequirementsInspection extends PyInspection {
|
||||
myLanguageLevel = languageLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
|
||||
@@ -128,6 +128,11 @@ public class PyShadowingBuiltinsInspection extends PyInspection {
|
||||
return getFamilyName() + " \"" + myName + "\"";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
|
||||
@@ -56,6 +56,11 @@ public class AddIgnoredIdentifierQuickFix implements LocalQuickFix, LowPriorityA
|
||||
return "Ignore unresolved reference";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
final PsiElement context = descriptor.getPsiElement();
|
||||
|
||||
@@ -110,6 +110,11 @@ public class GenerateBinaryStubsFix implements LocalQuickFix {
|
||||
return "Generate binary stubs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
|
||||
final PsiFile file = descriptor.getPsiElement().getContainingFile();
|
||||
|
||||
Reference in New Issue
Block a user