mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[python-inspections] IgnoreErrorFix: preview-friendly
Fixes EA-659085 - SEGSENAE: SideEffectGuard.checkSideEffectAllowed GitOrigin-RevId: 738ca33f4e8e542d47f66c9b3bce42b9c0453390
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5bacfb79a9
commit
5929958466
@@ -166,7 +166,7 @@ public class PyPep8NamingInspection extends PyInspection {
|
||||
}
|
||||
}
|
||||
|
||||
protected static class IgnoreErrorFix implements LocalQuickFix {
|
||||
protected class IgnoreErrorFix implements LocalQuickFix {
|
||||
private final String myCode;
|
||||
|
||||
IgnoreErrorFix(String code) {
|
||||
@@ -179,6 +179,19 @@ public class PyPep8NamingInspection extends PyInspection {
|
||||
return PyPsiBundle.message("QFIX.NAME.ignore.errors.like.this");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) {
|
||||
if (ignoredErrors.contains(myCode)) return IntentionPreviewInfo.EMPTY;
|
||||
ArrayList<String> updated = new ArrayList<>(ignoredErrors);
|
||||
updated.add(myCode);
|
||||
return IntentionPreviewInfo.addListOption(updated, myCode, PyPsiBundle.message("INSP.pep8.naming.column.name.ignored.errors"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
final PsiFile file = descriptor.getStartElement().getContainingFile();
|
||||
|
||||
Reference in New Issue
Block a user