MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolveRazorUsing

Method resolveRazorUsing

src/resolution/index.ts:1252–1265  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 1

resolveOneMethod · 0.95

Calls 3

getRazorUsingsMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected