spanFor method

  1. @override
SourceMapSpan? spanFor(
  1. int line,
  2. int column, {
  3. Map<String, SourceFile>? files,
  4. String? uri,
})
override

Returns the span associated with line and column.

uri is the optional location of the output file to find the span for to disambiguate cases where a mapping may have different mappings for different output files.

Implementation

@override
SourceMapSpan? spanFor(int line, int column,
    {Map<String, SourceFile>? files, String? uri}) {
  // TODO(jacobr): perhaps verify that targetUrl matches the actual uri
  // or at least ends in the same file name.
  var index = _indexFor(line, column);
  return _maps[index].spanFor(
      line - _lineStart[index], column - _columnStart[index],
      files: files);
}