sourceSpanWithLineInfo function

SourceSpan sourceSpanWithLineInfo(
  1. int offset,
  2. int length,
  3. String source,
  4. Uri uri,
)

Creates a source span with line and column numbers.

Implementation

SourceSpan sourceSpanWithLineInfo(
  int offset,
  int length,
  String source,
  Uri uri,
) {
  final sourceFile = SourceFile.fromString(source, url: uri);
  return sourceFile.span(offset, offset + length);
}