make file writable in python rename quick fixes

This commit is contained in:
peter
2016-11-23 16:02:41 +01:00
parent 6f74964ac8
commit 53df3e657c
2 changed files with 11 additions and 1 deletions
@@ -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);
@@ -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;