mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Clean up
#KTIJ-10071 GitOrigin-RevId: 527c2d9f0ed17c4add81ff89b1cd75c872b9e324
This commit is contained in:
committed by
intellij-monorepo-bot
parent
57f7e14ea5
commit
c0ca763393
@@ -332,7 +332,7 @@ public class MarkerType {
|
||||
ContainerUtil.addIfNotNull(inheritors, collectProcessor.getFoundElement());
|
||||
ContainerUtil.addIfNotNull(inheritors, collectExprProcessor.getFoundElement());
|
||||
if (inheritors.isEmpty()) return;
|
||||
final SubclassUpdater subclassUpdater = new SubclassUpdater(aClass, renderer, inheritors);
|
||||
final SubclassUpdater subclassUpdater = new SubclassUpdater(aClass, renderer);
|
||||
inheritors.sort(renderer.getComparator());
|
||||
PsiElementListNavigator.openTargets(e, inheritors.toArray(NavigatablePsiElement.EMPTY_NAVIGATABLE_ELEMENT_ARRAY),
|
||||
subclassUpdater.getCaption(inheritors.size()), CodeInsightBundle.message("goto.implementation.findUsages.title", aClass.getName()), renderer, subclassUpdater);
|
||||
@@ -362,16 +362,10 @@ public class MarkerType {
|
||||
@IntellijInternalApi
|
||||
public static final class SubclassUpdater extends OverridingMembersUpdater {
|
||||
private final PsiClass myClass;
|
||||
private final List<NavigatablePsiElement> myInheritors;
|
||||
|
||||
public SubclassUpdater(
|
||||
@NotNull PsiClass aClass,
|
||||
@NotNull PsiElementListCellRenderer<NavigatablePsiElement> renderer,
|
||||
@NotNull List<NavigatablePsiElement> inheritors
|
||||
) {
|
||||
public SubclassUpdater(@NotNull PsiClass aClass, @NotNull PsiElementListCellRenderer<NavigatablePsiElement> renderer) {
|
||||
super(aClass.getProject(), JavaAnalysisBundle.message("subclasses.search.progress.title"), renderer);
|
||||
myClass = aClass;
|
||||
myInheritors = inheritors;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -395,20 +389,13 @@ public class MarkerType {
|
||||
@Override
|
||||
public void run(@NotNull final ProgressIndicator indicator) {
|
||||
super.run(indicator);
|
||||
final Set<NavigatablePsiElement> navigatablePsiElementSet = new HashSet<>(myInheritors);
|
||||
ClassInheritorsSearch.search(myClass, ReadAction.compute(() -> PsiSearchHelper.getInstance(myProject).getUseScope(myClass)), true).forEach(
|
||||
new CommonProcessors.CollectProcessor<>() {
|
||||
@Override
|
||||
public boolean process(final PsiClass o) {
|
||||
if (!updateComponent(o)) {
|
||||
indicator.cancel();
|
||||
}
|
||||
ProgressManager.checkCanceled();
|
||||
if (navigatablePsiElementSet.add(o)) {
|
||||
myInheritors.add(o);
|
||||
}
|
||||
return super.process(o);
|
||||
o -> {
|
||||
if (!updateComponent(o)) {
|
||||
indicator.cancel();
|
||||
}
|
||||
ProgressManager.checkCanceled();
|
||||
return true;
|
||||
});
|
||||
|
||||
collectFunctionalInheritors(indicator, myClass);
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ fun buildNavigateToClassInheritorsPopup(e: MouseEvent?, element: PsiElement?): N
|
||||
|
||||
inheritors.sortWith(renderer.comparator as Comparator<in NavigatablePsiElement>)
|
||||
|
||||
val updater = MarkerType.SubclassUpdater(psiClass, renderer, inheritors)
|
||||
val updater = MarkerType.SubclassUpdater(psiClass, renderer)
|
||||
|
||||
val className = psiClass.name
|
||||
return NavigationPopupDescriptor(
|
||||
|
||||
Reference in New Issue
Block a user