mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
refactorings: collapse same named elements together (IDEA-155284)
This commit is contained in:
@@ -18,20 +18,25 @@ package com.intellij.refactoring.util;
|
||||
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.lang.findUsages.DescriptiveNameUtil;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.ex.FocusChangeListener;
|
||||
import com.intellij.ui.EditorSettingsProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.ElementDescriptionUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.ElementDescriptionUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.refactoring.RefactoringBundle;
|
||||
import com.intellij.ui.EditorSettingsProvider;
|
||||
import com.intellij.usageView.UsageViewUtil;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -63,15 +68,10 @@ public class RefactoringUIUtil {
|
||||
}
|
||||
|
||||
public static String calculatePsiElementDescriptionList(PsiElement[] elements) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (int i = 0; i < elements.length; i++) {
|
||||
if (i > 0) buffer.append(", ");
|
||||
buffer.append(UsageViewUtil.getType(elements[i]));
|
||||
buffer.append(" ");
|
||||
buffer.append(DescriptiveNameUtil.getDescriptiveName(elements[i]));
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
final Function<PsiElement, String> presentationFun = element -> UsageViewUtil.getType(element) +
|
||||
" " +
|
||||
DescriptiveNameUtil.getDescriptiveName(element);
|
||||
return StringUtil.join(ContainerUtil.map2LinkedSet(Arrays.asList(elements), presentationFun), ", ");
|
||||
}
|
||||
|
||||
public static final EditorSettingsProvider SELECT_ALL_ON_FOCUS = new EditorSettingsProvider() {
|
||||
|
||||
Reference in New Issue
Block a user