Package com.intellij.lang.javascript.psi

Examples of com.intellij.lang.javascript.psi.JSFunction


        if (jsClass != null)
        {
            for (String functionName : functionNames)
            {
                //Find the "mapView" function on IMediatorMap so we can find where it's used throughout the app
                JSFunction foundFunction = jsClass.findFunctionByName(functionName);

                if (foundFunction != null)
                {
                    //Find all the usages of "mapView" and return then as UsageInfo
                    List<UsageInfo2UsageAdapter> mapViewUsages = FindUsagesUtils.findUsagesOfPsiElement(foundFunction, project);
View Full Code Here


                if (aClass.getName().equals("com.intellij.codeInsight.hint.ParameterInfoComponent")){
                    fakeParameterInfoComponent.setComponent((JPanel) component);
                    Object[] objects = fakeParameterInfoComponent.getObjects();
                    if (objects[0] instanceof JSFunction){
                        JSFunction jsFunctionObject = (JSFunction) objects[0];

                        if (jsFunctionObject.getParameterList().getText().equals("(...valueObjects)")){
                            PsiElement psiElement = fakeParameterInfoComponent.getMyParameterOwner();

                            Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
                            PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
                            JSCallExpression jsCallExpression = SignalsUtils.getCallExpressionFromCaret(editor, file);

                            JSArgumentList argumentList = jsCallExpression.getArgumentList();
                            PsiReference reference = argumentList.getPrevSibling().getFirstChild().getReference();
                            JSArgumentList signalParams = SignalsUtils.getStringParametersFromSignalReference(reference);

                            JSFunction jsFunction = (JSFunction) JSChangeUtil.createJSTreeFromText(psiElement.getProject(), "function foo" + signalParams.getText(), JavaScriptSupportLoader.ECMA_SCRIPT_L4).getPsi();
                            fakeParameterInfoComponent.setMyObjects(new Object[]{jsFunction});
                            fakeParameterInfoComponent.update();
                        }
                    }
                }
View Full Code Here

        //What's a better way to find a JSClass from a String? I want to find: org.robotlegs.core.IMediatorMap
        JSClass jsClass = (JSClass) JSResolveUtil.findElementsByName(className, project, GlobalSearchScope.allScope(project)).iterator().next();

        //Find the "mapView" function on IMediatorMap so we can find where it's used throughout the app
        JSFunction mapView = jsClass.findFunctionByName(functionName);

        //Find all the usages of "mapView" and return then as UsageInfo
        List<UsageInfo2UsageAdapter> mapViewUsages = findUsagesOfPsiElement(mapView, project);

        //Create a map of the first param (the "view") to the second param (the "mediator")
View Full Code Here

TOP

Related Classes of com.intellij.lang.javascript.psi.JSFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.