mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-87657 IOE at com.intellij.psi.impl.CheckUtil.checkWritable fixed
This commit is contained in:
+3
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.intention.impl;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -38,7 +39,6 @@ public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionA
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
|
||||
final PsiReference reference = file.findReferenceAt(editor.getCaretModel().getOffset());
|
||||
final FileReference fileReference = reference == null ? null : findFileReference(reference);
|
||||
|
||||
@@ -81,6 +81,8 @@ public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionA
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
|
||||
final PsiReference reference = file.findReferenceAt(editor.getCaretModel().getOffset());
|
||||
final FileReference fileReference = reference == null ? null : findFileReference(reference);
|
||||
if (fileReference != null) {
|
||||
|
||||
Reference in New Issue
Block a user