private boolean matchesScope(@NotNull VirtualFile file, @NotNull Project project, @NotNull ProjectFileIndex fileIndex) {
    boolean isSource = fileIndex.isInSourceContent(file);
    return switch (myScope) {
      case ANY -> fileIndex.isInContent(file) && matchesModule(file, fileIndex);
      case SOURCE -> isSource && !TestSourcesFilter.isTestSources(file, project) && matchesModule(file, fileIndex);
      case LIBRARY -> fileIndex.isInLibrary(file) && matchesLibrary(myModulePattern, file, fileIndex);
      case TEST -> isSource && TestSourcesFilter.isTestSources(file, project) && matchesModule(file, fileIndex);
      case PROBLEM -> isSource && WolfTheProblemSolver.getInstance(project).isProblemFile(file) && matchesModule(file, fileIndex);
    };
  }
private boolean matchesScope(@NotNull VirtualFile file, @NotNull Project project, @NotNull ProjectFileIndex fileIndex)