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

Function pointerLineFor

src/mcp/tools.ts:1230–1239  ·  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

1228 * price of the source bytes this section exists to point away from.
1229 */
1230function pointerLineFor(filePath: string, nodes: readonly Node[]): string {
1231 const POINTER_SYMBOLS = 6;
1232 const named = nodes.filter((n) => n.kind !== 'import' && n.kind !== 'export');
1233 const pool = named.length > 0 ? named : nodes;
1234 const shown = pool.slice(0, POINTER_SYMBOLS);
1235 const more = pool.length - shown.length;
1236 const symbols = shown.map((n) => `${n.name}:${n.startLine}`).join(', ')
1237 + (more > 0 ? `, +${more} more` : '');
1238 return `- ${filePath}: ${symbols}`;
1239}
1240/**
1241 * Emitted when the response was too full to carry ANY of its pointer list. It
1242 * 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