* Resolve a Razor/Blazor simple type ref through the file's `@using` * namespaces: `CatalogBrand` + `@using BlazorShared.Models` → the node whose * qualified name is `BlazorShared.Models::CatalogBrand`. Only resolves when the * `@using` set yields exactly ONE type (otherwise it stays ambigu
(ref: UnresolvedRef)
| 4195 | * through to name-matching). |
| 4196 | */ |
| 4197 | private resolveRazorUsing(ref: UnresolvedRef): ResolvedRef | null { |
| 4198 | if (ref.referenceName.includes('.') || ref.referenceName.includes('::')) return null; |
| 4199 | const usings = this.getRazorUsings(ref.filePath); |
| 4200 | if (usings.length === 0) return null; |
| 4201 | const found = new Map<string, Node>(); |
| 4202 | for (const ns of usings) { |
| 4203 | for (const cand of this.context.getNodesByQualifiedName(`${ns}::${ref.referenceName}`)) { |
| 4204 | found.set(cand.id, cand); |
| 4205 | } |
| 4206 | } |
| 4207 | if (found.size !== 1) return null; |
| 4208 | const target = found.values().next().value!; |
| 4209 | return { original: ref, targetNodeId: target.id, confidence: 0.9, resolvedBy: 'import' }; |
| 4210 | } |
| 4211 | |
| 4212 | /** |
| 4213 | * Resolve a CFML inheritance reference written as a component path (#1152). |
no test coverage detected