Examples of GoPsiElement


Examples of ro.redeul.google.go.lang.psi.GoPsiElement

    public static GoFunctionDeclaration getFunctionDeclaration(@Nullable PsiElement identifier) {

        if (!(identifier instanceof GoPsiElement))
            return null;

        GoPsiElement goPsiElement =  (GoPsiElement) identifier;

        // If the identifier is not definition identifier of function, try to resolve it.
        if (!isFunctionDeclarationIdentifier(goPsiElement)) {
            goPsiElement = GoPsiUtils.resolveSafely(goPsiElement, GoPsiElement.class);
        }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.GoPsiElement

    private Object[] convertToPresentation(GoPsiType type, GoPsiElement[] members) {

        Object[] presentations = new Object[members.length];

        for (int i = 0, numMembers = members.length; i < numMembers; i++) {
            GoPsiElement member = members[i];

            if (member instanceof GoLiteralIdentifier) {
                LookupElementBuilder presentation =
                        getFieldPresentation(type, (GoLiteralIdentifier) member);
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.GoPsiElement

        if (argumentCount == UNKNOWN_COUNT || expectedCount == UNKNOWN_COUNT) {
            return;
        }

        String name = "";
        GoPsiElement id = getCallFunctionIdentifier(call);
        if (id != null) {
            name = id.getText();
        }

        if (expectedCount == VARIADIC_COUNT) {
            GoTypeInspectUtil.checkFunctionTypeArguments(call, result);
        } else {
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.GoPsiElement

    }

    @Override
    public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) {
        if ( element instanceof GoPsiElement ) {
            GoPsiElement psiElement = (GoPsiElement) element;
            visitor.setData(state);
            psiElement.accept(visitor);
            return shouldContinueSolving();
        }

        return true;
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.GoPsiElement

                       @Nullable("is null when called from inspection") final Editor editor,
                       @NotNull PsiElement startElement, @NotNull PsiElement endElement) {

        final PsiElement p = findChildOfClass(findParentOfType(startElement, GoFunctionDeclaration.class), GoBlockStatement.class);

        GoPsiElement childOfClass = findChildOfClass(p, GoVarDeclarations.class);
        if (childOfClass == null)
            childOfClass = findChildOfClass(p, GoVarDeclaration.class);
        if (childOfClass == null)
            childOfClass = findChildOfClass(p, GoShortVarDeclaration.class);

        ArrayList<String> arguments = new ArrayList<String>();
        final String fnArguments = CreateFunctionFix.InspectionGenFuncArgs(startElement, arguments);

        final int insertPoint;

        if (childOfClass == null) {
            insertPoint = p.getTextOffset() + 2;
        } else {
            insertPoint = childOfClass.getTextRange().getEndOffset();
        }


        Document doc = PsiDocumentManager.getInstance(startElement.getProject()).getDocument(file);
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.