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

Method getCode

src/context/index.ts:1283–1290  ·  view source on GitHub ↗

* Get the source code for a node * * Reads the file and extracts the code between startLine and endLine. * * @param nodeId - ID of the node * @returns Code string or null if not found

(nodeId: string)

Source from the content-addressed store, hash-verified

1281 * @returns Code string or null if not found
1282 */
1283 async getCode(nodeId: string): Promise<string | null> {
1284 const node = this.queries.getNodeById(nodeId);
1285 if (!node) {
1286 return null;
1287 }
1288
1289 return this.extractNodeCode(node);
1290 }
1291
1292 /**
1293 * Extract code from a node's source file

Callers 1

renderNodeSectionMethod · 0.45

Calls 2

extractNodeCodeMethod · 0.95
getNodeByIdMethod · 0.65

Tested by

no test coverage detected