@Override
  public PsiFileSystemItem findRoot(final @NotNull Project project, final @NotNull VirtualFile file) {
    final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
    VirtualFile contentRootForFile = index.getSourceRootForFile(file);
    if (contentRootForFile == null) contentRootForFile = index.getContentRootForFile(file);

    if (contentRootForFile != null) {
      return PsiManager.getInstance(project).findDirectory(contentRootForFile);
    }
    return null;
  }
@Override
  public PsiFileSystemItem findRoot(final @NotNull Project project, final @NotNull VirtualFile file)