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

Function moduleNames

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

Source from the content-addressed store, hash-verified

1036 const index = buildPythonModuleIndex(context);
1037 const roots = [...index.projectRoots, ...index.localRoots.keys()];
1038 const moduleNames = (file: string): string[] => {
1039 const out: string[] = [];
1040 const mod = file.replace(/(?:^|\/)__init__\.py$/, '').replace(/\.py$/, '');
1041 for (const root of roots) {
1042 if (root && !mod.startsWith(`${root}/`)) continue;
1043 const rel = root ? mod.slice(root.length + 1) : mod;
1044 if (rel) out.push(rel.replace(/\//g, '.'));
1045 }
1046 return out;
1047 };
1048 const affected = new Set<string>();
1049 const sourceDirs = new Set<string>();
1050 for (const raw of changedFiles) {

Callers 1

pythonReopenScopeFunction · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected