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

Function moduleNames

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

Source from the content-addressed store, hash-verified

1284 const index = buildPythonModuleIndex(context);
1285 const roots = [...index.projectRoots, ...index.localRoots.keys()];
1286 const moduleNames = (file: string): string[] => {
1287 const out: string[] = [];
1288 const mod = file.replace(/(?:^|\/)__init__\.py$/, '').replace(/\.py$/, '');
1289 for (const root of roots) {
1290 if (root && !mod.startsWith(`${root}/`)) continue;
1291 const rel = root ? mod.slice(root.length + 1) : mod;
1292 if (rel) out.push(rel.replace(/\//g, '.'));
1293 }
1294 return out;
1295 };
1296 const affected = new Set<string>();
1297 const sourceDirs = new Set<string>();
1298 for (const raw of changedFiles) {

Callers 1

pythonReopenScopeFunction · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected