break;
case MESSAGE_OR_PACKAGE_OR_GROUP: {
PbFile containingFile = (PbFile) ref.getElement().getContainingFile();
//resolve in subpackages scope
//alg: find subpackage and then find it in subpackages
PsiPackage subPackage = resolveInSubPackagesScope((PsiPackage) scope, refName);
if (subPackage != null) {
//f(subPackage, thisFile) -> boolean
//true if this subPackage in visible scope either false
if (PbPsiUtil.isVisibleSubPackage(subPackage, containingFile)) {
return subPackage;