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

Function pointerLineFor

src/mcp/tools.ts:1224–1233  ·  view source on GitHub ↗

* One pointer line: the file plus enough symbol names to make it NAMEABLE in a * follow-up explore. Capped — an un-capped list ran to ~1.9K on the #1500 * fixture (12 generated CRUD symbols on one line), meta-text bought at the * price of the source bytes this section exists to point away from.

(filePath: string, nodes: readonly Node[])

Source from the content-addressed store, hash-verified

1222 * price of the source bytes this section exists to point away from.
1223 */
1224function pointerLineFor(filePath: string, nodes: readonly Node[]): string {
1225 const POINTER_SYMBOLS = 6;
1226 const named = nodes.filter((n) => n.kind !== 'import' && n.kind !== 'export');
1227 const pool = named.length > 0 ? named : nodes;
1228 const shown = pool.slice(0, POINTER_SYMBOLS);
1229 const more = pool.length - shown.length;
1230 const symbols = shown.map((n) => `${n.name}:${n.startLine}`).join(', ')
1231 + (more > 0 ? `, +${more} more` : '');
1232 return `- ${filePath}: ${symbols}`;
1233}
1234/**
1235 * Emitted when the response was too full to carry ANY of its pointer list. It
1236 * is the one line the epilogue floor is reserved for: the list itself can be

Callers 1

handleExploreMethod · 0.85

Calls 2

mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected