boolean (PsiFileSystemItem directory) { if (directory == null) return true; VirtualFile vFile = directory.getVirtualFile(); if (vFile == null) return true; Project project = directory.getProject(); return isRoot(vFile, project); }