Examples of GoFunctionParameter


Examples of ro.redeul.google.go.lang.psi.toplevel.GoFunctionParameter

        assertEquals(func.getParameters().length, 1);
    }

    public void testUnnamedParamVariadic() throws Exception {
        GoFile file = get(parse("package main; func a(...int) { }"));
        GoFunctionParameter param =
            childAt(0,
                    childAt(0,
                            file.getFunctions()
                    ).getParameters()
            );

        assertEquals(param.isVariadic(), true);
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.toplevel.GoFunctionParameter

                   .findChildByType(GoElementTypes.FUNCTION_PARAMETER_LIST);

        if (list == null)
            return GoFunctionParameter.EMPTY_ARRAY;

        GoFunctionParameter params[] =
            PsiTreeUtil.getChildrenOfType(list.getPsi(),
                                          GoFunctionParameter.class);

        return params != null ? params : GoFunctionParameter.EMPTY_ARRAY;
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.toplevel.GoFunctionParameter

            return;
        }

        // only last argument could be variadic
        for (int i = 0; i < parameters.length - 1; i++) {
            GoFunctionParameter parameter = parameters[i];
            if (parameter.isVariadic()) {
                result.addProblem(parameter, GoBundle.message("error.variadic.not.the.last"));
            }
        }
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.toplevel.GoFunctionParameter

        StringBuilder presentationText = new StringBuilder();

        presentationText.append("(");
        GoFunctionParameter[] parameters = getParameters();
        for (int i = 0; i < parameters.length; i++) {
            GoFunctionParameter parameter = parameters[i];
            presentationText.append(parameter.getLookupTailText());
            if (i < parameters.length - 1) {
                presentationText.append(",");
            }
        }

        presentationText.append(")");

        GoFunctionParameter[] results = getResults();

        if (results.length == 0)
            return presentationText.toString();

        presentationText.append(" (");
        for (int i = 0; i < results.length; i++) {
            GoFunctionParameter parameter = results[i];
            presentationText.append(parameter.getLookupTailText());
            if (i < results.length - 1) {
                presentationText.append(",");
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.