check for file read-only status in IntroduceEmptyVariableHandler (following IDEA-CR-21447)

This commit is contained in:
Dmitry Batrak
2017-05-30 11:52:14 +03:00
parent 5e8d36181c
commit 8da03edcea
@@ -45,6 +45,7 @@ public class IntroduceEmptyVariableHandler {
public void invoke(@NotNull Editor editor, @NotNull PsiFile file, @NotNull PsiType type) {
Project project = file.getProject();
if (!CommonRefactoringUtil.checkReadOnlyStatus(project, file)) return;
int offset = editor.getCaretModel().getOffset();
PsiElement at = file.findElementAt(offset);
PsiElement anchorStatement = RefactoringUtil.getParentStatement(at, false);