Convert a PHP FQN `Foo\Bar\Baz` to the stored `Foo\Bar::Baz` and emit an `imports` ref.
(fqn: string, fromNodeId: string, node: SyntaxNode)
| 3561 | |
| 3562 | /** Convert a PHP FQN `Foo\Bar\Baz` to the stored `Foo\Bar::Baz` and emit an `imports` ref. */ |
| 3563 | private pushPhpUseRef(fqn: string, fromNodeId: string, node: SyntaxNode): void { |
| 3564 | const clean = fqn.replace(/^\\/, ''); |
| 3565 | const lastSep = clean.lastIndexOf('\\'); |
| 3566 | if (lastSep < 0) return; // global-namespace class — already matches by simple name |
| 3567 | this.unresolvedReferences.push({ |
| 3568 | fromNodeId, |
| 3569 | referenceName: `${clean.slice(0, lastSep)}::${clean.slice(lastSep + 1)}`, |
| 3570 | referenceKind: 'imports', |
| 3571 | line: node.startPosition.row + 1, |
| 3572 | column: node.startPosition.column, |
| 3573 | }); |
| 3574 | } |
| 3575 | |
| 3576 | /** |
| 3577 | * Emit one `imports` reference per name imported in a Python |
no outgoing calls
no test coverage detected