Package protobuf.lang.psi.api.reference

Examples of protobuf.lang.psi.api.reference.PbRef.resolve()


    @Nullable
    @Override
    public PsiElement getQualifier() {
        PbRef ref = getQualifierRef(); // Call into the old method for finding the qualifying reference.
        PsiElement refEl = ref != null ? ref.resolve() : null; // If the reference exists, resolve its element.
        return refEl;
    }

    /**
     * The #getQualifier() method signature changed in Idea 12 to return a PsiElement.  This method simply maintains
View Full Code Here


                case MESSAGE_OR_GROUP:
                case MESSAGE_OR_ENUM_OR_GROUP:
                case MESSAGE_OR_PACKAGE_OR_GROUP:
                case EXTEND_FIELD: {
                    if (qualifier != null) {    //foo.bar
                        final PsiElement resolvedElement = qualifier.resolve();
                        if (resolvedElement != null) {
                            return PbResolveUtil.resolveInScope(PbPsiUtil.getScope(resolvedElement), ref);
                        }
                    } else if (ref.findChildByType(DOT) != null) {  //.foo
                        return PbResolveUtil.resolveInScope(PbPsiUtil.getRootScope(ref), ref);
View Full Code Here

                    }
                }
                break;
                case MESSAGE_OR_GROUP_FIELD: {
                    if (qualifier != null) {
                        final PsiElement resolvedElement = qualifier.resolve();
                        if (resolvedElement != null) {
                            return PbResolveUtil.resolveInScope(PbPsiUtil.getTypeScope(resolvedElement), ref);
                        }
                    }
                }
View Full Code Here

    }

    @Override
    public PbFile getAliasedFile() {
        PbRef ref = this.findChildByClass(PbRef.class);
        return ref != null ? (PbFile) ref.resolve() : null;
    }
}
View Full Code Here

    public static PsiElement getTypeScope(final PsiElement element) {
        if (element instanceof PbFieldDef) {
            PbRef typeRef = ((PbFieldDef) element).getTypeRef();
            if (typeRef != null) {
                PsiElement resolvedElement = typeRef.resolve();
                if (resolvedElement != null) {
                    return getScope(resolvedElement);
                }
            }
            return null;
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.