Examples of GoPsiElement


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

    @Override
    protected void invoke(Project project, Editor editor, GoFile file) {
        int start = editor.getSelectionModel().getSelectionStart();
        int end = editor.getSelectionModel().getSelectionEnd();
        GoPsiElement element = findElementOfClassAtRange(file, start, end, GoPsiElement.class);
        DeleteStmtFix.deleteStatement(element);
    }
View Full Code Here

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

        expandAllUsage(ctx, usage, initializer);

        removeIdentifierDeclaration(ctx);

        GoPsiElement scope = scopePointer.getElement();
        if (scope != null) {
            reformatPositions(scope);
        }
    }
View Full Code Here

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

            return (GoPsiElement) parent.getLastChild();
        }
        if (element instanceof GoLiteralIdentifier) {
            for (PsiReference reference : element.getReferences()) {
                if (reference != null) {
                    GoPsiElement resolve = (GoPsiElement) reference.resolve();
                    if (resolve != null && !resolve.equals(element))
                        return ResolveTypeOfVarDecl(resolve);
                }
            }
        }
        return element;
View Full Code Here

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

    }

    public void annotate(@NotNull PsiElement element,
                         @NotNull AnnotationHolder holder) {
        if (element instanceof GoPsiElement) {
            GoPsiElement goPsiElement = (GoPsiElement) element;

            try {
                annotationHolder = holder;

                goPsiElement.accept(this);
            } finally {
                annotationHolder = null;
            }
        }
    }
View Full Code Here

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

    protected void introduceCurrentOccurrence(GoExpr current) throws GoRefactoringException {
        introduceAllOccurrence(current, new GoExpr[]{current});
    }

    private void appendConstToLastImportOrPackage(RangeMarker[] exprMarkers, String declaration) {
        GoPsiElement lastElement;
        GoImportDeclarations[] imports = file.getImportDeclarations();
        if (imports.length != 0) {
            lastElement = imports[imports.length - 1];
        } else {
            lastElement = file.getPackage();
        }

        int offset = lastElement.getTextRange().getEndOffset();
        String stmt = "\n\nconst $" + VARIABLE + "$ = " + declaration;
        startRenaming(editor, exprMarkers, offset, stmt, null);
    }
View Full Code Here

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

            return;
        }

        Map<GoLiteralIdentifier, PsiElement> localIdentifiers = getAllLocalIdentifiers();
        Set<PsiElement> parents = getParentsOfIdentifierDeclarations(localIdentifiers);
        GoPsiElement visitStartElement = defaultVisitStartElement;
        if (!parents.isEmpty()) {
            PsiElement p = expr.getParent();
            while (p != null && !parents.contains(p)) {
                p = p.getParent();
            }
View Full Code Here

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

        Collections.addAll(declarations, parameter.getIdentifiers());
    }

    @Override
    public void visitLiteralExpression(GoLiteralExpression expression) {
        GoPsiElement psiElement = resolveSafely(expression, GoPsiElement.class);
        if (psiElement != null) {
            usages.add(psiElement);
        } else {
            visitElement(expression);
        }
View Full Code Here

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

        }
    }

    @Override
    public void visitLiteralIdentifier(GoLiteralIdentifier identifier) {
        GoPsiElement psiElement = resolveSafely(identifier, GoPsiElement.class);
        if (psiElement != null) {
            usages.add(psiElement);
        }
    }
View Full Code Here

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

        if (psiType instanceof GoPsiTypeFunction)
            return GoUtil.CompareTypes(psiType, null, expr);

        if (firstChildOfExp instanceof GoLiteralIdentifier) {
            GoPsiElement goPsiElement = GoUtil.ResolveTypeOfVarDecl((GoPsiElement) firstChildOfExp);
            if (goPsiElement instanceof GoPsiType)
                return GoUtil.CompareTypes(psiType, goPsiElement);
        }
        if (expr instanceof GoCallOrConvExpression && firstChildOfExp instanceof GoPsiTypeParenthesized) {
            return GoUtil.CompareTypes(psiType, ((GoPsiTypeParenthesized) firstChildOfExp).getInnerType(), expr);
View Full Code Here

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

                    return new GoType[]{GoType.Nil};

                if (identifier.isIota())
                    return new GoType[]{GoTypes.constant(GoTypeConstant.Kind.Integer, identifier.getIotaValue())};

                GoPsiElement resolved = GoPsiUtils.resolveSafely(identifier, GoPsiElement.class);
                if (resolved == null) {
                    return GoType.EMPTY_ARRAY;
                }

                return resolved.accept(new GoElementVisitorWithData<GoType[]>(GoType.EMPTY_ARRAY) {

                    GoLiteralIdentifier resolvedIdent = null;

                    @Override
                    public void visitImportDeclaration(GoImportDeclaration declaration) {
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.