public static boolean isGeneratedOrExcluded(@NotNull Project project, @NotNull VirtualFile file) {
    ProjectFileIndex fileIndex = ProjectFileIndex.getInstance(project);
    return fileIndex.isExcluded(file) || GeneratedSourcesFilter.isGeneratedSourceByAnyFilter(file, project);
  }
public static boolean isGeneratedOrExcluded(@NotNull Project project, @NotNull VirtualFile file)