Search in sources :

Example 1 with JSCallerMethodsTreeStructure

use of com.intellij.lang.javascript.hierarchy.call.JSCallerMethodsTreeStructure in project intellij-plugins by JetBrains.

the class FlexHierarchyTest method doJSCallHierarchyTest.

private void doJSCallHierarchyTest(final String hierarchyType, final String classFqn, final String methodName, final String scope, final String... fileNames) throws Exception {
    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;
        if (CallHierarchyBrowserBase.CALLEE_TYPE.equals(hierarchyType)) {
            return new JSCalleeMethodsTreeStructure(myProject, jsFunction, scope);
        } else if (CallHierarchyBrowserBase.CALLER_TYPE.equals(hierarchyType)) {
            return new JSCallerMethodsTreeStructure(myProject, jsFunction, scope);
        }
        throw new IllegalArgumentException("Wrong hierarchy type: " + hierarchyType);
    }, fileNames);
}
Also used : JSCalleeMethodsTreeStructure(com.intellij.lang.javascript.hierarchy.call.JSCalleeMethodsTreeStructure) JSFunction(com.intellij.lang.javascript.psi.JSFunction) JSCallerMethodsTreeStructure(com.intellij.lang.javascript.hierarchy.call.JSCallerMethodsTreeStructure) JSClass(com.intellij.lang.javascript.psi.ecmal4.JSClass)

Aggregations

JSCalleeMethodsTreeStructure (com.intellij.lang.javascript.hierarchy.call.JSCalleeMethodsTreeStructure)1 JSCallerMethodsTreeStructure (com.intellij.lang.javascript.hierarchy.call.JSCallerMethodsTreeStructure)1 JSFunction (com.intellij.lang.javascript.psi.JSFunction)1 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)1