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

Function importedNames

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

The last names of a file's `Imports` (a type imported this way lends its shared members; an alias lends none).

(file: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

1826
1827/** The last names of a file's `Imports` (a type imported this way lends its shared members; an alias lends none). */
1828function importedNames(file: string, context: ResolutionContext): Set<string> {
1829 let memo = VB_TYPE_IMPORTS.get(context);
1830 if (!memo) VB_TYPE_IMPORTS.set(context, (memo = new Map()));
1831 const hit = memo.get(file);
1832 if (hit) return hit;
1833 const names = new Set<string>();
1834 for (const line of headerLines(file, context)) {
1835 const m = /^\s*Imports\s+([\w.]+)\s*$/i.exec(line);
1836 if (m) names.add(m[1]!.split('.').pop()!.toLowerCase());
1837 }
1838 memo.set(file, names);
1839 return names;
1840}
1841
1842const VB_SCOPES = new WeakMap<ResolutionContext, WeakMap<UnresolvedRef, Set<string> | null>>();
1843

Callers 2

isVbNestedTypeInScopeFunction · 0.70
isVbMemberInScopeFunction · 0.70

Calls 5

headerLinesFunction · 0.85
getMethod · 0.65
execMethod · 0.65
setMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected