use of com.jetbrains.lang.dart.ide.hierarchy.method.DartMethodHierarchyTreeStructure in project intellij-plugins by JetBrains.
the class DartMethodHierarchyTest method doMethodHierarchyTest.
private void doMethodHierarchyTest(final String className, final String methodName, final boolean shouldHide, final String... fileNames) throws Exception {
doHierarchyTest(() -> {
final Project project = getProject();
final List<DartComponentName> dartComponentNames = DartClassIndex.getItemsByName(className, project, GlobalSearchScope.projectScope(project));
for (DartComponentName name : dartComponentNames) {
DartClass dartClass = PsiTreeUtil.getParentOfType(name, DartClass.class);
if (dartClass != null && className.equals(dartClass.getName())) {
PsiElement member = dartClass.findMemberByName(methodName);
if (member == null) {
member = findReference(dartClass, methodName);
}
if (member == null) {
fail("Method not found");
}
if (shouldHide) {
HierarchyBrowserManager.State state = HierarchyBrowserManager.getInstance(myProject).getState();
assert state != null;
state.HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED = true;
}
return new DartMethodHierarchyTreeStructure(project, (DartComponent) member);
}
}
return null;
}, fileNames);
}
Aggregations