mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add both add field and remove param QuickFixes for the param in __init__ method
This commit is contained in:
@@ -300,17 +300,14 @@ public class PyUnusedLocalInspectionVisitor extends PyInspectionVisitor {
|
||||
boolean canRemove = !(PsiTreeUtil.getPrevSiblingOfType(element, PyParameter.class) instanceof PySingleStarParameter) ||
|
||||
PsiTreeUtil.getNextSiblingOfType(element, PyParameter.class) != null;
|
||||
|
||||
final LocalQuickFix[] fixes;
|
||||
final List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>();
|
||||
if (mayBeField) {
|
||||
fixes = new LocalQuickFix[]{new AddFieldQuickFix(name, name, containingClass.getName())};
|
||||
fixes.add(new AddFieldQuickFix(name, name, containingClass.getName()));
|
||||
}
|
||||
else if (canRemove) {
|
||||
fixes = new LocalQuickFix[]{new PyRemoveParameterQuickFix()};
|
||||
if (canRemove) {
|
||||
fixes.add(new PyRemoveParameterQuickFix());
|
||||
}
|
||||
else {
|
||||
fixes = LocalQuickFix.EMPTY_ARRAY;
|
||||
}
|
||||
registerWarning(element, PyBundle.message("INSP.unused.locals.parameter.isnot.used", name), fixes);
|
||||
registerWarning(element, PyBundle.message("INSP.unused.locals.parameter.isnot.used", name), fixes.toArray(new LocalQuickFix[fixes.size()]));
|
||||
}
|
||||
else {
|
||||
if (myIgnoreTupleUnpacking && isTupleUnpacking(element)) {
|
||||
|
||||
Reference in New Issue
Block a user