mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[intentions preview] rename wrong reference
GitOrigin-RevId: 04eea92c006dd160dc5219621959e981e71c52d2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0054a9203c
commit
fec94113b4
@@ -1,8 +1,9 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
package com.intellij.codeInsight.daemon.impl.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.daemon.QuickFixBundle;
|
||||
import com.intellij.codeInsight.intention.FileModifier;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.LowPriorityAction;
|
||||
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
|
||||
@@ -21,6 +22,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
@@ -42,6 +44,11 @@ public class RenameWrongRefFix implements IntentionAction, LowPriorityAction {
|
||||
myUnresolvedOnly = unresolvedOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable FileModifier getFileModifierForPreview(@NotNull PsiFile target) {
|
||||
return new RenameWrongRefFix(PsiTreeUtil.findSameElementInCopy(myRefExpr, target), myUnresolvedOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
@@ -150,7 +157,9 @@ public class RenameWrongRefFix implements IntentionAction, LowPriorityAction {
|
||||
|
||||
TemplateManager.getInstance(project).startTemplate(editor, template);
|
||||
|
||||
EditorUtil.setVerticalScrollProportion(editor, proportion);
|
||||
if (file.isPhysical()) {
|
||||
EditorUtil.setVerticalScrollProportion(editor, proportion);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user