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

Function moduleNames

src/resolution/import-resolver.ts:1022–1031  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

1020 const index = buildPythonModuleIndex(context);
1021 const roots = [...index.projectRoots, ...index.localRoots.keys()];
1022 const moduleNames = (file: string): string[] => {
1023 const out: string[] = [];
1024 const mod = file.replace(/(?:^|\/)__init__\.py$/, '').replace(/\.py$/, '');
1025 for (const root of roots) {
1026 if (root && !mod.startsWith(`${root}/`)) continue;
1027 const rel = root ? mod.slice(root.length + 1) : mod;
1028 if (rel) out.push(rel.replace(/\//g, '.'));
1029 }
1030 return out;
1031 };
1032 const affected = new Set<string>();
1033 const sourceDirs = new Set<string>();
1034 for (const raw of changedFiles) {

Callers 1

pythonReopenScopeFunction · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected