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

Function getFileReferenceId

packages/web/src/features/chat/utils.ts:228–230  ·  view source on GitHub ↗
({ repo, path, range }: Omit<FileReference, 'type' | 'id'>)

Source from the content-addressed store, hash-verified

226}
227
228export const getFileReferenceId = ({ repo, path, range }: Omit<FileReference, 'type' | 'id'>) => {
229 return `file-reference-${repo}::${path}${range ? `-${range.startLine}-${range.endLine}` : ''}`;
230}
231
232export const fileReferenceToString = ({ repo, path, range }: Omit<FileReference, 'type' | 'id'>) => {
233 return `${FILE_REFERENCE_PREFIX}{${repo}::${path}${range ? `:${range.startLine}-${range.endLine}` : ''}}`;

Callers 2

createFileReferenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected