()
| 104 | } |
| 105 | |
| 106 | private createFileNode(): Node { |
| 107 | const lines = this.source.split('\n'); |
| 108 | const id = generateNodeId(this.filePath, 'file', this.filePath, 1); |
| 109 | const node: Node = { |
| 110 | id, |
| 111 | kind: 'file', |
| 112 | name: this.filePath.split('/').pop() || this.filePath, |
| 113 | qualifiedName: this.filePath, |
| 114 | filePath: this.filePath, |
| 115 | language: 'xml', |
| 116 | startLine: 1, |
| 117 | endLine: lines.length || 1, |
| 118 | startColumn: 0, |
| 119 | endColumn: lines[lines.length - 1]?.length ?? 0, |
| 120 | updatedAt: Date.now(), |
| 121 | }; |
| 122 | this.nodes.push(node); |
| 123 | return node; |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Find the mapper root and its dialect. Two shapes are recognized: |
no test coverage detected