mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
[spell-checker] Allow to provide custom name for spellchecker variants
Fixes IDEA-344686 Spellchecker: RenameTo QuickFix uses wrong name to generate suggestons objects in Scala GitOrigin-RevId: 00f00a67dc9bd1eacaeea2890c7f07b6d037f0c7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
95fab49390
commit
56b91582b2
@@ -7,6 +7,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiNamedElement;
|
||||
import com.intellij.psi.PsiNamedElementWithCustomPresentation;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.rename.RenameUtil;
|
||||
import com.intellij.spellchecker.SpellCheckerManager;
|
||||
@@ -29,7 +30,7 @@ public class RenameTo extends PsiUpdateModCommandQuickFix implements Iconable {
|
||||
protected void applyFix(@NotNull Project project, @NotNull PsiElement psiElement, @NotNull ModPsiUpdater updater) {
|
||||
PsiNamedElement named = PsiTreeUtil.getNonStrictParentOfType(psiElement, PsiNamedElement.class);
|
||||
if (named == null) return;
|
||||
String name = named.getName();
|
||||
String name = named instanceof PsiNamedElementWithCustomPresentation custom ? custom.getPresentationName() : named.getName();
|
||||
if (name == null) return;
|
||||
List<String> names = SpellCheckerManager.getInstance(project).getSuggestions(name)
|
||||
.stream()
|
||||
|
||||
Reference in New Issue
Block a user