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

Function decodeLine

ui/src/lib/highlight.ts:78–87  ·  view source on GitHub ↗
(wire: readonly WireToken[], classes: readonly string[])

Source from the content-addressed store, hash-verified

76 * a silent mis-underline rather than a visible error.
77 */
78export function decodeLine(wire: readonly WireToken[], classes: readonly string[]): Token[] {
79 const out: Token[] = [];
80 let col = 0;
81 for (const [id, text] of wire) {
82 const name = classes[id];
83 out.push({ cls: CLASS_NAMES.has(name as string) ? (name as TokenClass) : 'other', text, col });
84 col += text.length;
85 }
86 return out;
87}
88
89/**
90 * Split a line into identifier runs with no syntax classification at all.

Callers 3

tokensOfFunction · 0.90
tokensByLineFunction · 0.85

Calls 2

pushMethod · 0.80
hasMethod · 0.80

Tested by 1

tokensOfFunction · 0.72