private static boolean isUnder(@NotNull Project project, @NotNull VirtualFile file) {
    ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
    return fileIndex.isInContent(file) || fileIndex.isExcluded(file);
  }
private static boolean isUnder(@NotNull Project project, @NotNull VirtualFile file)