PsiPackage (PsiPackage pack, GlobalSearchScope scope) { List<PsiPackage> subPackages = ContainerUtil.filter(pack.getSubPackages(scope), PACKAGE_CONDITION); return subPackages.size() == 1 ? getBasePackage(subPackages.get(0), scope) : pack; }