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)
| 1826 | |
| 1827 | /** The last names of a file's `Imports` (a type imported this way lends its shared members; an alias lends none). */ |
| 1828 | function 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 | |
| 1842 | const VB_SCOPES = new WeakMap<ResolutionContext, WeakMap<UnresolvedRef, Set<string> | null>>(); |
| 1843 |
no test coverage detected