mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
stub hierarchy searcher: honor includeAnonymous parameter
This commit is contained in:
@@ -36,6 +36,7 @@ import java.util.*;
|
||||
public class SingleClassHierarchy extends ClassHierarchy {
|
||||
private final BitSet myCoveredFiles;
|
||||
private final BitSet myAmbiguousSupers;
|
||||
private final BitSet myAnonymous;
|
||||
private final List<StubClassAnchor> myCoveredClasses;
|
||||
private final StubClassAnchor[] myClassAnchors;
|
||||
private final StubClassAnchor[] myClassAnchorsByFileIds;
|
||||
@@ -49,6 +50,7 @@ public class SingleClassHierarchy extends ClassHierarchy {
|
||||
excludeUncoveredFiles(classSymbols);
|
||||
connectSubTypes(classSymbols);
|
||||
myAmbiguousSupers = calcAmbiguousSupers(classSymbols);
|
||||
myAnonymous = calcAnonymous(classSymbols);
|
||||
myCoveredClasses = Collections.unmodifiableList(ContainerUtil.filter(myClassAnchors, this::isCovered));
|
||||
}
|
||||
|
||||
@@ -63,6 +65,17 @@ public class SingleClassHierarchy extends ClassHierarchy {
|
||||
return ambiguousSupers;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static BitSet calcAnonymous(ClassSymbol[] classSymbols) {
|
||||
BitSet answer = new BitSet();
|
||||
for (ClassSymbol symbol : classSymbols) {
|
||||
if (!symbol.isHierarchyIncomplete() && symbol.myShortName == NamesEnumerator.NO_NAME) {
|
||||
answer.set(symbol.myClassAnchor.myId);
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static BitSet calcCoveredFiles(ClassSymbol[] classSymbols) {
|
||||
BitSet problematicFiles = new BitSet();
|
||||
@@ -127,6 +140,11 @@ public class SingleClassHierarchy extends ClassHierarchy {
|
||||
return myAmbiguousSupers.get(((StubClassAnchor)anchor).myId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAnonymous(@NotNull SmartClassAnchor anchor) {
|
||||
return myAnonymous.get(((StubClassAnchor)anchor).myId);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GlobalSearchScope restrictToUncovered(@NotNull GlobalSearchScope scope) {
|
||||
|
||||
Reference in New Issue
Block a user