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);