updateFileContexts method

Future<bool> updateFileContexts(
  1. Set<String> filePaths
)

Inform the analyzer that the provided filePaths have been updated.

This will trigger a re-analysis of the files and return true if the updated files should trigger a code generation.

Implementation

Future<bool> updateFileContexts(Set<String> filePaths) async {
  await _refreshContextForFiles(filePaths);

  var oldDefinitionsLength = _endpointDefinitions.length;
  await analyze(collector: CodeGenerationCollector());

  if (_endpointDefinitions.length != oldDefinitionsLength) {
    return true;
  }

  return filePaths.any((e) => _isEndpointFile(File(e)));
}