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

Method resolveRazorUsing

src/resolution/index.ts:2137–2150  ·  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

2135 * through to name-matching).
2136 */
2137 private resolveRazorUsing(ref: UnresolvedRef): ResolvedRef | null {
2138 if (ref.referenceName.includes('.') || ref.referenceName.includes('::')) return null;
2139 const usings = this.getRazorUsings(ref.filePath);
2140 if (usings.length === 0) return null;
2141 const found = new Map<string, Node>();
2142 for (const ns of usings) {
2143 for (const cand of this.context.getNodesByQualifiedName(`${ns}::${ref.referenceName}`)) {
2144 found.set(cand.id, cand);
2145 }
2146 }
2147 if (found.size !== 1) return null;
2148 const target = found.values().next().value!;
2149 return { original: ref, targetNodeId: target.id, confidence: 0.9, resolvedBy: 'import' };
2150 }
2151
2152 /**
2153 * Resolve a CFML inheritance reference written as a component path (#1152).

Callers 1

resolveOneMethod · 0.95

Calls 3

getRazorUsingsMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected