toSourceSpanFromPath method
SourceSpan
toSourceSpanFromPath(
- String path,
- String source
)
Implementation
SourceSpan toSourceSpanFromPath(String path, String source) {
// TODO: integrate endNode functionality here
// final offset = !withCommentOrMetadata && node is AnnotatedNode
// ? node.firstTokenAfterCommentAndMetadata.offset
// : node.offset;
// final end = endNode?.end ?? node.end;
final startOffset = offset;
final endOffset = end;
return SourceSpan(
SourceLocation(
startOffset,
sourceUrl: path,
// column: startLocation.columnNumber,
// line: startLocation.lineNumber,
),
SourceLocation(
endOffset,
sourceUrl: path,
// column: endLocation.columnNumber,
// line: endLocation.lineNumber,
),
source,
);
}