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

Function typesInNamespace

src/resolution/vbnet-receivers.ts:916–925  ·  view source on GitHub ↗

* The project types named `name` declared directly in namespace `ns` (full * segments): the caller's project's, if it has one — SCrawler's projects * share a root namespace — and null when that leaves two different types.

(ns: string[], name: string, ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

914 * share a root namespace — and null when that leaves two different types.
915 */
916function typesInNamespace(ns: string[], name: string, ref: UnresolvedRef, context: ResolutionContext): Node[] | null {
917 const key = ns.join('.');
918 let found = projectTypesNamed(name, context, VB_READ_TYPE_KINDS)
919 .filter((c) => fullSegments(c, context).slice(0, -1).join('.') === key);
920 const own = found.filter((c) => sameVbProject(c.filePath, ref.filePath, context));
921 if (own.length > 0) found = own;
922 const distinct = new Set(found.map((c) => `${projectOf(c.filePath, context)}|${c.qualifiedName.toLowerCase()}`));
923 return distinct.size > 1 ? null
924 : [...found.filter((c) => c.filePath === ref.filePath), ...found.filter((c) => c.filePath !== ref.filePath)];
925}
926
927/** A member named `name` of a `Module` declared directly in namespace `ns`, which VB.NET reads through the namespace: `Assets.Logo`. */
928function moduleMemberIn(ns: string[], name: string, ref: UnresolvedRef, context: ResolutionContext): Node | undefined {

Callers 2

memberAtFunction · 0.85
matchVbMemberReadFunction · 0.85

Calls 6

projectTypesNamedFunction · 0.85
fullSegmentsFunction · 0.85
sameVbProjectFunction · 0.85
projectOfFunction · 0.85
mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected