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

Method renderNodeSection

src/mcp/tools.ts:3996–4012  ·  view source on GitHub ↗

Render one symbol: details + (optional) body/outline + its caller/callee trail.

(cg: CodeGraph, node: Node, includeCode: boolean)

Source from the content-addressed store, hash-verified

3994
3995 /** Render one symbol: details + (optional) body/outline + its caller/callee trail. */
3996 private async renderNodeSection(cg: CodeGraph, node: Node, includeCode: boolean): Promise<string> {
3997 let code: string | null = null;
3998 let outline: string | null = null;
3999 if (includeCode) {
4000 // For container symbols (class/interface/struct/…), the full body is the
4001 // sum of every method body — a wall of source. Return a structural outline
4002 // (members + signatures + line numbers) instead; leaf symbols return their
4003 // full body.
4004 if (CONTAINER_NODE_KINDS.has(node.kind)) {
4005 outline = this.buildContainerOutline(cg, node);
4006 }
4007 if (!outline) {
4008 code = await cg.getCode(node.id);
4009 }
4010 }
4011 return this.formatNodeDetails(node, code, outline) + this.formatTrail(cg, node);
4012 }
4013
4014 /**
4015 * Build the "trail" for a symbol: its direct callees (what it calls) and

Callers 1

handleNodeMethod · 0.95

Calls 5

buildContainerOutlineMethod · 0.95
formatNodeDetailsMethod · 0.95
formatTrailMethod · 0.95
hasMethod · 0.80
getCodeMethod · 0.45

Tested by

no test coverage detected