Examples of GoLiteralIdentifier


Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    }

    private boolean isReferenceToIdentifierOfSelector(Map<Integer, PsiElement> expectedElements,
                                                      PsiElement refElement) {
        if (refElement instanceof GoSelectorExpression) {
            GoLiteralIdentifier identifier = ((GoSelectorExpression) refElement).getIdentifier();
            if (identifier != null) {
                if (expectedElements.remove(identifier.getTextOffset()) != null) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    public void testIdentifierIsWholeStatement() throws Exception { doTest(); }

    @Override
    protected void invoke(final Project project, final Editor editor, final GoFile file) {
        PsiElement element = file.findElementAt(editor.getSelectionModel().getSelectionStart());
        final GoLiteralIdentifier identifier = findParentOfType(element, GoLiteralIdentifier.class);
        assertNotNull(identifier);

        CommandProcessor.getInstance().executeCommand(project, new Runnable() {
            @Override
            public void run() {
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    public void testSimple() throws Exception{ doTest(); }

    @Override
    protected void invoke(Project project, Editor editor, GoFile file) {
        PsiElement element = file.findElementAt(editor.getSelectionModel().getSelectionStart());
        GoLiteralIdentifier identifier = findParentOfType(element, GoLiteralIdentifier.class);
        assertNotNull(identifier);
        InspectionManager im = InspectionManager.getInstance(project);
        LocalQuickFix fix = null;
        ProblemDescriptor pd = im.createProblemDescriptor(identifier, "", fix, ProblemHighlightType.ERROR, true);
        new ConvertToAssignmentFix().applyFix(project, pd);
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    public void testAppendToMultipleVariable() throws Exception{ doTest(); }

    @Override
    protected void invoke(final Project project, final Editor editor, final GoFile file) {
        PsiElement element = file.findElementAt(editor.getSelectionModel().getSelectionStart());
        final GoLiteralIdentifier identifier = findParentOfType(element, GoLiteralIdentifier.class);
        assertNotNull(identifier);

        CommandProcessor.getInstance().executeCommand(project, new Runnable() {
            @Override
            public void run() {
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    public void testStruct() throws Exception { doTest(); }

    @Override
    protected void invoke(final Project project, final Editor editor, final GoFile file) {
        PsiElement element = file.findElementAt(editor.getSelectionModel().getSelectionStart());
        final GoLiteralIdentifier identifier = findParentOfType(element, GoLiteralIdentifier.class);
        assertNotNull(identifier);

        CommandProcessor.getInstance().executeCommand(project, new Runnable() {
            @Override
            public void run() {
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    public String generateDoc(PsiElement element, PsiElement originalElement) {
        if (!(element.getContainingFile() instanceof GoFile)) {
            return "";
        }

        GoLiteralIdentifier identifier = null;
        if (element instanceof GoLiteralIdentifier) {
            identifier = (GoLiteralIdentifier) element;
            element = element.getParent();
        }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

            String message = GoBundle.message("error.unknown.refactoring.case");
            CommonRefactoringUtil.showErrorHint(project, editor, message, "Refactoring error!", null);
            return;
        }

        GoLiteralIdentifier identifier = (GoLiteralIdentifier) element;
        GoVarDeclaration declaration = (GoVarDeclaration) statement;
        try {
            inlineElement(new InlineContext(project, editor, identifier, declaration, (GoPsiElement) scope));
        } catch (GoRefactoringException e) {
            if (ApplicationManager.getApplication().isUnitTestMode()) {
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    @Override
    public void visitLiteralExpression(GoLiteralExpression expression) {
        super.visitLiteralExpression(expression);

        if (expression.getLiteral().getType() == GoLiteral.Type.Identifier) {
            GoLiteralIdentifier identifier = (GoLiteralIdentifier) expression.getLiteral();
            processLiteralIdentifier(identifier);
        }
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

        }

        for (GoPsiElement declaration : declarations) {

            if (psiElement(GoLiteralIdentifier.class).accepts(declaration)) {
                GoLiteralIdentifier ident = (GoLiteralIdentifier) declaration;

                if (ident.isIota() || ident.isBlank())
                    continue;

                if (GLOBAL_CONST_DECL.accepts(ident) ||
                    GLOBAL_VAR_DECL.accepts(ident)) {
                    if (GoNamesUtil.isExported(ident.getName())) {
                        continue;
                    }

                    if (GLOBAL_CONST_DECL.accepts(ident)) {
                        result.addProblem(declaration,
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralIdentifier

    @Override
    public void visitShortVarDeclaration(GoShortVarDeclaration declaration) {
        GoLiteralIdentifier[] identifiers = declaration.getIdentifiers();

        for (GoLiteralIdentifier identifier : identifiers) {
            GoLiteralIdentifier definition = resolveSafely(identifier,
                                                           GoLiteralIdentifier.class);
            if (definition == null) {
                declarations.add(identifier);
            } else {
                usages.add(definition);
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.