(node: Node, content: string)
| 105 | } |
| 106 | |
| 107 | function extractNodeContent(node: Node, content: string): string { |
| 108 | const byteSlice = sliceUtf8(content, node.startIndex, node.endIndex); |
| 109 | const codeUnitSlice = content.slice(node.startIndex, node.endIndex); |
| 110 | |
| 111 | if (node.text === codeUnitSlice && node.text !== byteSlice) { |
| 112 | return codeUnitSlice; |
| 113 | } |
| 114 | |
| 115 | return byteSlice; |
| 116 | } |
| 117 | |
| 118 | function isTreeSitterDebugEnabled(): boolean { |
| 119 | return Boolean(process.env.CODEBASE_CONTEXT_DEBUG); |
no test coverage detected