mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
view implementations: show self first (IDEA-123377)
This commit is contained in:
@@ -115,6 +115,9 @@ public class ImplementationsViewTest extends LightCodeInsightFixtureTestCase {
|
||||
new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0);
|
||||
try {
|
||||
final String[] visibleFiles = component.getVisibleFiles();
|
||||
assertTrue(visibleFiles.length > 0);
|
||||
assertEquals(visibleFiles[0], "a.java (AFoo)");
|
||||
Arrays.sort(visibleFiles);
|
||||
Assert.assertArrayEquals(Arrays.toString(visibleFiles),
|
||||
new String[]{"a.java (AFoo)", "a.java (AFoo1 in AFoo)", "a.java (AFoo2 in AFoo)", "a.java (AFoo3 in AFoo)"}, visibleFiles);
|
||||
}
|
||||
|
||||
@@ -330,15 +330,6 @@ public class ImplementationViewComponent extends JPanel {
|
||||
names.add(((PsiNamedElement)element).getName());
|
||||
}
|
||||
}
|
||||
Arrays.sort(elements, new Comparator<PsiElement>() {
|
||||
@Override
|
||||
public int compare(PsiElement e1, PsiElement e2) {
|
||||
if (e1 instanceof PsiNamedElement && e2 instanceof PsiNamedElement) {
|
||||
return Comparing.compare(((PsiNamedElement)e1).getName(), ((PsiNamedElement)e2).getName());
|
||||
}
|
||||
return e1.hashCode() - e2.hashCode();
|
||||
}
|
||||
});
|
||||
for (PsiElement element : elements) {
|
||||
PsiFile file = getContainingFile(element);
|
||||
if (file == null) continue;
|
||||
|
||||
Reference in New Issue
Block a user