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