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

Function knownNamespaces

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

* 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)

Source from the content-addressed store, hash-verified

862 * one: `acme`, `acme.billing`, `scrawler.api.reddit`.
863 */
864function 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. */
878function namespaceAround(file: string, line: number, context: ResolutionContext): string[] {

Callers 2

namespaceNamedFunction · 0.85
memberAtFunction · 0.85

Calls 7

fullSegmentsFunction · 0.85
projectInfoFunction · 0.85
addFunction · 0.70
getMethod · 0.65
getNodesByKindMethod · 0.65
getAllFilesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected