MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / renderNodeSection

Method renderNodeSection

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

3886
3887 /** Render one symbol: details + (optional) body/outline + its caller/callee trail. */
3888 private async renderNodeSection(cg: CodeGraph, node: Node, includeCode: boolean): Promise<string> {
3889 let code: string | null = null;
3890 let outline: string | null = null;
3891 if (includeCode) {
3892 // For container symbols (class/interface/struct/…), the full body is the
3893 // sum of every method body — a wall of source. Return a structural outline
3894 // (members + signatures + line numbers) instead; leaf symbols return their
3895 // full body.
3896 if (CONTAINER_NODE_KINDS.has(node.kind)) {
3897 outline = this.buildContainerOutline(cg, node);
3898 }
3899 if (!outline) {
3900 code = await cg.getCode(node.id);
3901 }
3902 }
3903 return this.formatNodeDetails(node, code, outline) + this.formatTrail(cg, node);
3904 }
3905
3906 /**
3907 * 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