boolean (@NotNull PsiDirectory dir) { final VirtualFile file = dir.getVirtualFile(); final VirtualFile sourceRoot = ProjectRootManager.getInstance(dir.getProject()).getFileIndex().getSourceRootForFile(file); return file.equals(sourceRoot); }