* 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)
| 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 |
no test coverage detected