Search in sources :

Example 1 with JSMethodHierarchyTreeStructure

use of com.intellij.lang.javascript.hierarchy.method.JSMethodHierarchyTreeStructure in project intellij-plugins by JetBrains.

the class FlexHierarchyTest method doJSMethodHierarchyTest.

private void doJSMethodHierarchyTest(final String classFqn, final String methodName, final boolean hideClassesWhereMethodNotImplemented, final String... fileNames) throws Exception {
    final HierarchyBrowserManager.State state = HierarchyBrowserManager.getInstance(myProject).getState();
    final boolean oldState = state.HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED;
    state.HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED = hideClassesWhereMethodNotImplemented;
    doHierarchyTest(() -> {
        final JSClass jsClass = (JSClass) JSDialectSpecificHandlersFactory.forLanguage(JavaScriptSupportLoader.ECMA_SCRIPT_L4).getClassResolver().findClassByQName(classFqn, GlobalSearchScope.moduleScope(myModule));
        assert jsClass != null;
        final JSFunction jsFunction = jsClass.findFunctionByName(methodName);
        assert jsFunction != null;
        return new JSMethodHierarchyTreeStructure(myProject, jsFunction);
    }, fileNames);
    state.HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED = oldState;
}
Also used : JSFunction(com.intellij.lang.javascript.psi.JSFunction) JSMethodHierarchyTreeStructure(com.intellij.lang.javascript.hierarchy.method.JSMethodHierarchyTreeStructure) HierarchyBrowserManager(com.intellij.ide.hierarchy.HierarchyBrowserManager) JSClass(com.intellij.lang.javascript.psi.ecmal4.JSClass)

Aggregations

HierarchyBrowserManager (com.intellij.ide.hierarchy.HierarchyBrowserManager)1 JSMethodHierarchyTreeStructure (com.intellij.lang.javascript.hierarchy.method.JSMethodHierarchyTreeStructure)1 JSFunction (com.intellij.lang.javascript.psi.JSFunction)1 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)1