* 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)
| 1250 | * through to name-matching). |
| 1251 | */ |
| 1252 | private resolveRazorUsing(ref: UnresolvedRef): ResolvedRef | null { |
| 1253 | if (ref.referenceName.includes('.') || ref.referenceName.includes('::')) return null; |
| 1254 | const usings = this.getRazorUsings(ref.filePath); |
| 1255 | if (usings.length === 0) return null; |
| 1256 | const found = new Map<string, Node>(); |
| 1257 | for (const ns of usings) { |
| 1258 | for (const cand of this.context.getNodesByQualifiedName(`${ns}::${ref.referenceName}`)) { |
| 1259 | found.set(cand.id, cand); |
| 1260 | } |
| 1261 | } |
| 1262 | if (found.size !== 1) return null; |
| 1263 | const target = found.values().next().value!; |
| 1264 | return { original: ref, targetNodeId: target.id, confidence: 0.9, resolvedBy: 'import' }; |
| 1265 | } |
| 1266 | |
| 1267 | /** |
| 1268 | * Resolve a `this.<member>` function-as-value reference (#756/#808) to the |
no test coverage detected