analyzeFiles method

Future<void> analyzeFiles({
  1. required AnalysisContext analysisContext,
  2. required List<String> paths,
})

Analyzes the given files. By default invokes analyzeFile for every file. Implementations may override to optimize for batch analysis.

Implementation

Future<void> analyzeFiles({
  required AnalysisContext analysisContext,
  required List<String> paths,
}) async {
  final pathSet = paths.toSet();

  // First analyze priority files.
  for (final path in priorityPaths) {
    pathSet.remove(path);
    await analyzeFile(
      analysisContext: analysisContext,
      path: path,
    );
  }

  // Then analyze the remaining files.
  for (final path in pathSet) {
    await analyzeFile(
      analysisContext: analysisContext,
      path: path,
    );
  }
}