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

Function classNamed

src/resolution/pascal-scope.ts:2538–2546  ·  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

2536
2537/** A class (or record or interface) a type name names, seen from `fromFile`. */
2538function classNamed(typeName: string, fromFile: string, context: ResolutionContext): Node | null {
2539 const simple = typeName.split('.').pop()!.toLowerCase();
2540 const memo = memos(context).classByName;
2541 const key = `${fromFile}|${simple}`;
2542 if (memo.has(key)) return memo.get(key)!;
2543 const cls = classThroughAliases(simple, fromFile, context, new Set([key]));
2544 memo.set(key, cls);
2545 return cls;
2546}
2547
2548/**
2549 * The steps an alias walk takes at most: well past any real chain, and short

Callers 9

headOfFunction · 0.70
withSubjectTypeFunction · 0.70
typeOfLinksFunction · 0.70
valueOfDeclarationFunction · 0.70
typeOfTextFunction · 0.70
hierarchyInProjectFunction · 0.70
classByQualifiedNameFunction · 0.70
visibleClassNamedFunction · 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