diff --git a/python/src/com/jetbrains/python/inspections/quickfix/PyRenameElementQuickFix.java b/python/src/com/jetbrains/python/inspections/quickfix/PyRenameElementQuickFix.java index 02a760247f67..83f2d15049ab 100644 --- a/python/src/com/jetbrains/python/inspections/quickfix/PyRenameElementQuickFix.java +++ b/python/src/com/jetbrains/python/inspections/quickfix/PyRenameElementQuickFix.java @@ -99,6 +99,11 @@ public class PyRenameElementQuickFix implements LocalQuickFix { return false; } + @Override + public boolean shouldMakeCurrentFileWritable() { + return true; + } + private static void renameInUnitTestMode(@NotNull Project project, @NotNull PsiNameIdentifierOwner nameOwner, @Nullable Editor editor) { final PsiElement substitution = RenamePsiElementProcessor.forElement(nameOwner).substituteElementToRename(nameOwner, editor); diff --git a/python/src/com/jetbrains/python/inspections/quickfix/RenameParameterQuickFix.java b/python/src/com/jetbrains/python/inspections/quickfix/RenameParameterQuickFix.java index 7869568c6203..b19febf369db 100644 --- a/python/src/com/jetbrains/python/inspections/quickfix/RenameParameterQuickFix.java +++ b/python/src/com/jetbrains/python/inspections/quickfix/RenameParameterQuickFix.java @@ -38,7 +38,7 @@ public class RenameParameterQuickFix implements LocalQuickFix { public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { final PsiElement elt = descriptor.getPsiElement(); - if (elt != null && elt instanceof PyNamedParameter && elt.isWritable()) { + if (elt != null && elt instanceof PyNamedParameter) { new RenameProcessor(project, elt, myNewName, false, true).run(); } } @@ -53,6 +53,11 @@ public class RenameParameterQuickFix implements LocalQuickFix { return PyBundle.message("QFIX.rename.parameter.to.$0", myNewName); } + @Override + public boolean shouldMakeCurrentFileWritable() { + return true; + } + @Override public boolean startInWriteAction() { return false;