mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-psi] PsiElementFinderImpl.getClasses: sort by name first
Sorting by scope might be slow and appears sometimes in profiles May improve IJPL-181700 com.intellij.codeInsight.daemon.impl.HighlightVisitorRunner.runVisitor holds read lock for 700ms during typing processing GitOrigin-RevId: 9342af5afa24a730711f25b2010f51aff54f85ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8344605e41
commit
9bed95b431
@@ -117,7 +117,12 @@ public final class PsiElementFinderImpl extends PsiElementFinder implements Dumb
|
||||
}
|
||||
|
||||
if (list.size() > 1) {
|
||||
ContainerUtil.quickSort(list, PsiClassUtil.createScopeComparator(scope));
|
||||
if (shortName != null) {
|
||||
ContainerUtil.quickSort(list, PsiClassUtil.createScopeComparator(scope));
|
||||
} else {
|
||||
ContainerUtil.quickSort(list, Comparator.comparing(PsiClass::getName, Comparator.nullsLast(Comparator.naturalOrder()))
|
||||
.thenComparing(PsiClassUtil.createScopeComparator(scope)));
|
||||
}
|
||||
}
|
||||
|
||||
return list.toArray(PsiClass.EMPTY_ARRAY);
|
||||
|
||||
Reference in New Issue
Block a user