MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / convertRange

Function convertRange

packages/web/src/features/search/zoektSearcher.ts:404–415  ·  view source on GitHub ↗
(range: ZoektGrpcRange)

Source from the content-addressed store, hash-verified

402 const fileName = file.file_name.toString('utf-8');
403
404 const convertRange = (range: ZoektGrpcRange): SourceRange => ({
405 start: {
406 byteOffset: range.start?.byte_offset ?? 0,
407 column: range.start?.column ?? 1,
408 lineNumber: range.start?.line_number ?? 1,
409 },
410 end: {
411 byteOffset: range.end?.byte_offset ?? 0,
412 column: range.end?.column ?? 1,
413 lineNumber: range.end?.line_number ?? 1,
414 }
415 })
416
417 // If a file has multiple branches, default to the first one.
418 const branchName = file.branches.length > 0 ? file.branches[0] : undefined;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected