* Extract Pascal uses clause into individual import nodes
(node: SyntaxNode)
| 6334 | * Extract Pascal uses clause into individual import nodes |
| 6335 | */ |
| 6336 | private extractPascalUses(node: SyntaxNode): void { |
| 6337 | const importText = getNodeText(node, this.source).trim(); |
| 6338 | for (let i = 0; i < node.namedChildCount; i++) { |
| 6339 | const child = node.namedChild(i); |
| 6340 | if (child?.type === 'moduleName') { |
| 6341 | const unitName = getNodeText(child, this.source); |
| 6342 | this.createNode('import', unitName, child, { |
| 6343 | signature: importText, |
| 6344 | }); |
| 6345 | // Create unresolved reference for resolution |
| 6346 | if (this.nodeStack.length > 0) { |
| 6347 | const parentId = this.nodeStack[this.nodeStack.length - 1]; |
| 6348 | if (parentId) { |
| 6349 | this.unresolvedReferences.push({ |
| 6350 | fromNodeId: parentId, |
| 6351 | referenceName: unitName, |
| 6352 | referenceKind: 'imports', |
| 6353 | line: child.startPosition.row + 1, |
| 6354 | column: child.startPosition.column, |
| 6355 | }); |
| 6356 | } |
| 6357 | } |
| 6358 | } |
| 6359 | } |
| 6360 | } |
| 6361 | |
| 6362 | /** |
| 6363 | * Extract a Pascal constant declaration |
no test coverage detected