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

Function classNamed

src/resolution/pascal-scope.ts:1002–1010  ·  view source on GitHub ↗

A class (or record or interface) a type name names, seen from `fromFile`.

(typeName: string, fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

1000
1001/** A class (or record or interface) a type name names, seen from `fromFile`. */
1002function classNamed(typeName: string, fromFile: string, context: ResolutionContext): Node | null {
1003 const simple = typeName.split('.').pop()!.toLowerCase();
1004 const memo = memos(context).classByName;
1005 const key = `${fromFile}|${simple}`;
1006 if (memo.has(key)) return memo.get(key)!;
1007 const cls = classThroughAliases(simple, fromFile, context, new Set([key]));
1008 memo.set(key, cls);
1009 return cls;
1010}
1011
1012/**
1013 * The steps an alias walk takes at most: well past any real chain, and short

Callers 4

headOfFunction · 0.70
classByQualifiedNameFunction · 0.70
ancestorsOfFunction · 0.70
typeOfMemberFunction · 0.70

Calls 5

memosFunction · 0.85
classThroughAliasesFunction · 0.85
hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected