Build the file's own `kind:'file'` node, spanning the whole source. Tag-based files need this explicitly — unlike `extractBareScript` (which delegates the whole file to `TreeSitterExtractor` and inherits its file node), `extractTagBased` walks the tree itself and has no other source of one.
()
| 179 | |
| 180 | /** Build the file's own `kind:'file'` node, spanning the whole source. Tag-based files need this explicitly — unlike `extractBareScript` (which delegates the whole file to `TreeSitterExtractor` and inherits its file node), `extractTagBased` walks the tree itself and has no other source of one. */ |
| 181 | private createFileNode(): Node { |
| 182 | const lines = this.source.split('\n'); |
| 183 | const id = generateNodeId(this.filePath, 'file', this.filePath, 1); |
| 184 | const fileNode: Node = { |
| 185 | id, |
| 186 | kind: 'file', |
| 187 | name: this.filePath.split(/[/\\]/).pop() || this.filePath, |
| 188 | qualifiedName: this.filePath, |
| 189 | filePath: this.filePath, |
| 190 | language: this.language, |
| 191 | startLine: 1, |
| 192 | endLine: lines.length, |
| 193 | startColumn: 0, |
| 194 | endColumn: lines[lines.length - 1]?.length || 0, |
| 195 | updatedAt: Date.now(), |
| 196 | }; |
| 197 | this.nodes.push(fileNode); |
| 198 | return fileNode; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Walks `program`'s named children with a single forward cursor (not an |
no test coverage detected