Convert a PHP FQN `Foo\Bar\Baz` to the stored `Foo\Bar::Baz` and emit an `imports` ref.
(fqn: string, fromNodeId: string, node: SyntaxNode)
| 5395 | |
| 5396 | /** Convert a PHP FQN `Foo\Bar\Baz` to the stored `Foo\Bar::Baz` and emit an `imports` ref. */ |
| 5397 | private pushPhpUseRef(fqn: string, fromNodeId: string, node: SyntaxNode): void { |
| 5398 | const clean = fqn.replace(/^\\/, ''); |
| 5399 | const lastSep = clean.lastIndexOf('\\'); |
| 5400 | if (lastSep < 0) return; // global-namespace class — already matches by simple name |
| 5401 | this.unresolvedReferences.push({ |
| 5402 | fromNodeId, |
| 5403 | referenceName: `${clean.slice(0, lastSep)}::${clean.slice(lastSep + 1)}`, |
| 5404 | referenceKind: 'imports', |
| 5405 | line: node.startPosition.row + 1, |
| 5406 | column: node.startPosition.column, |
| 5407 | }); |
| 5408 | } |
| 5409 | |
| 5410 | /** |
| 5411 | * Emit one `imports` reference per name imported in a Python |
no test coverage detected