boolean (final PsiElement element) { if (element instanceof PsiPackage) return true; return element instanceof PsiDirectory && JavaDirectoryService.getInstance().getPackageInSources((PsiDirectory)element) != null; }