* Every namespace the project's VB.NET code is declared in, by its full name * (lowercased, dot-joined, root namespace first), and each namespace around * one: `acme`, `acme.billing`, `scrawler.api.reddit`.
(context: ResolutionContext)
| 862 | * one: `acme`, `acme.billing`, `scrawler.api.reddit`. |
| 863 | */ |
| 864 | function knownNamespaces(context: ResolutionContext): Set<string> { |
| 865 | const hit = VB_NAMESPACES.get(context); |
| 866 | if (hit) return hit; |
| 867 | const known = new Set<string>(); |
| 868 | const add = (segments: string[]) => { |
| 869 | for (let i = 1; i <= segments.length; i++) known.add(segments.slice(0, i).join('.')); |
| 870 | }; |
| 871 | for (const n of context.getNodesByKind('namespace')) if (n.language === 'vbnet') add(fullSegments(n, context)); |
| 872 | for (const file of context.getAllFiles()) if (/\.vb$/i.test(file)) add(projectInfo(file, context).root); |
| 873 | VB_NAMESPACES.set(context, known); |
| 874 | return known; |
| 875 | } |
| 876 | |
| 877 | /** The namespace a line of a file is in, as full segments: its project's root namespace, then the `Namespace` block around it. */ |
| 878 | function namespaceAround(file: string, line: number, context: ResolutionContext): string[] { |
no test coverage detected