fetchFileUris method

Future<void> fetchFileUris(
  1. String isolateId,
  2. List<String> packageUris
)

Calls out to the VmService to lookup package URI to full file path mappings.

Known mappings are cached to avoid asking VmService redundantly.

  • isolateId - The ID of the isolate that the packageUris were generated on.
  • packageUris - List of URIs to fetch full file paths for.

Implementation

Future<void> fetchFileUris(String isolateId, List<String> packageUris) async {
  if (_packagePathMappings != null) {
    final fileUris =
        (await _service!.lookupResolvedPackageUris(isolateId, packageUris))
            .uris;

    // [_packagePathMappings] could have been set to null during the async gap
    // so check that it is non-null again here.
    if (fileUris != null && _packagePathMappings != null) {
      _packagePathMappings!.addMappings(
        isolateId: isolateId,
        fullPaths: fileUris,
        packagePaths: packageUris,
      );
    }
  }
}