Package ro.redeul.google.go.lang.psi.typing

Examples of ro.redeul.google.go.lang.psi.typing.GoTypeFunction


            GoType[] type = callExpression.getBaseExpression().getType();

            if ( type.length != 1 || ! (type[0] instanceof GoTypeFunction) )
                return "";

            GoTypeFunction function = (GoTypeFunction) type[0];

            int pos = -1;
            for (GoExpr expr : callExpression.getArguments()) {
                pos++;
                if ( expr.getTextOffset() == e.getTextOffset() && expr.getTextLength() == e.getTextLength() )
                    break;
            }

            GoType desiredType = function.getParameterType(pos);

            if ( desiredType instanceof GoTypeFunction ) {
                GoTypeFunction typeFunction = (GoTypeFunction) desiredType;
                int i = 0;

                stringBuilder.append("(");
                GoType parameterType = null;
                while ( (parameterType = typeFunction.getParameterType(i)) != null) {
                    stringList.add(String.format("arg%d", i));

                    if ( i > 0 )
                        stringBuilder.append(",");

                    stringBuilder.append(String.format("$v%d$ ", i));
                    stringBuilder.append(GoTypes.getRepresentation(parameterType, currentFile));
                    i++;
                }
                stringBuilder.append(")");

                GoType[] results = typeFunction.getResultTypes();
                if ( results.length > 1 ) stringBuilder.append("(");
                for (int i1 = 0; i1 < results.length; i1++) {
                    GoType goType = results[i1];
                    if( i1 > 0)
                        stringBuilder.append(",");
View Full Code Here

TOP

Related Classes of ro.redeul.google.go.lang.psi.typing.GoTypeFunction

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.