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

Method getCode

src/context/index.ts:1180–1187  ·  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

1178 * @returns Code string or null if not found
1179 */
1180 async getCode(nodeId: string): Promise<string | null> {
1181 const node = this.queries.getNodeById(nodeId);
1182 if (!node) {
1183 return null;
1184 }
1185
1186 return this.extractNodeCode(node);
1187 }
1188
1189 /**
1190 * 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