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

Method resolveRazorUsing

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

3903 * through to name-matching).
3904 */
3905 private resolveRazorUsing(ref: UnresolvedRef): ResolvedRef | null {
3906 if (ref.referenceName.includes('.') || ref.referenceName.includes('::')) return null;
3907 const usings = this.getRazorUsings(ref.filePath);
3908 if (usings.length === 0) return null;
3909 const found = new Map<string, Node>();
3910 for (const ns of usings) {
3911 for (const cand of this.context.getNodesByQualifiedName(`${ns}::${ref.referenceName}`)) {
3912 found.set(cand.id, cand);
3913 }
3914 }
3915 if (found.size !== 1) return null;
3916 const target = found.values().next().value!;
3917 return { original: ref, targetNodeId: target.id, confidence: 0.9, resolvedBy: 'import' };
3918 }
3919
3920 /**
3921 * Resolve a CFML inheritance reference written as a component path (#1152).

Callers 1

resolveOneInnerMethod · 0.95

Calls 4

getRazorUsingsMethod · 0.95
nextMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected