read method

  1. @override
Future<RepoFile> read(
  1. String path, {
  2. LineRange? range,
})
override

Reads path, optionally only the lines in range.

Implementation

@override
Future<RepoFile> read(String path, {LineRange? range}) async {
  final content = _requireFile(path);
  final slice = sliceLines(content, range);
  return RepoFile(
    path: normalizeRepoPath(path),
    content: slice.text,
    totalLines: slice.totalLines,
    startLine: range?.start,
    endLine: range == null ? null : (range.end ?? slice.totalLines),
  );
}