MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / claimedText

Function claimedText

__tests__/ui-highlight.test.ts:65–70  ·  view source on GitHub ↗

Which token an overlay ref claims — the whole point of the atomisation.

(result: HighlightResult, line: number, ref: LineRef)

Source from the content-addressed store, hash-verified

63
64/** Which token an overlay ref claims — the whole point of the atomisation. */
65function claimedText(result: HighlightResult, line: number, ref: LineRef): string | undefined {
66 const tokens = tokensOf(result, line);
67 const claimed = assignRefs(tokens, [ref]);
68 const [index] = [...claimed.keys()];
69 return index === undefined ? undefined : tokens[index]?.text;
70}
71
72describe('which languages classify', () => {
73 it('answers for every language the engine indexes, without throwing', () => {

Callers 1

Calls 2

assignRefsFunction · 0.90
tokensOfFunction · 0.85

Tested by

no test coverage detected