Search in sources :

Example 1 with DartServerSupertypesHierarchyTreeStructure

use of com.jetbrains.lang.dart.ide.hierarchy.type.DartServerSupertypesHierarchyTreeStructure in project intellij-plugins by JetBrains.

the class DartTypeHierarchyTest method doDartTypeHierarchyTest.

private void doDartTypeHierarchyTest(final String className, final boolean subtype, 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 && dartClass.getName().equals(className)) {
                if (subtype) {
                    return new DartServerTypeHierarchyTreeStructure(project, dartClass, HierarchyBrowserBaseEx.SCOPE_PROJECT);
                } else {
                    return new DartServerSupertypesHierarchyTreeStructure(project, dartClass);
                }
            }
        }
        return null;
    }, fileNames);
}
Also used : Project(com.intellij.openapi.project.Project) DartComponentName(com.jetbrains.lang.dart.psi.DartComponentName) DartClass(com.jetbrains.lang.dart.psi.DartClass) DartServerSupertypesHierarchyTreeStructure(com.jetbrains.lang.dart.ide.hierarchy.type.DartServerSupertypesHierarchyTreeStructure) DartServerTypeHierarchyTreeStructure(com.jetbrains.lang.dart.ide.hierarchy.type.DartServerTypeHierarchyTreeStructure)

Aggregations

Project (com.intellij.openapi.project.Project)1 DartServerSupertypesHierarchyTreeStructure (com.jetbrains.lang.dart.ide.hierarchy.type.DartServerSupertypesHierarchyTreeStructure)1 DartServerTypeHierarchyTreeStructure (com.jetbrains.lang.dart.ide.hierarchy.type.DartServerTypeHierarchyTreeStructure)1 DartClass (com.jetbrains.lang.dart.psi.DartClass)1 DartComponentName (com.jetbrains.lang.dart.psi.DartComponentName)1