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

Function pythonModuleFileNode

src/resolution/import-resolver.ts:1177–1181  ·  view source on GitHub ↗

The file node of the module `specifier` names, as seen from `fromFile`.

(specifier: string, fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

1175
1176/** The file node of the module `specifier` names, as seen from `fromFile`. */
1177function pythonModuleFileNode(specifier: string, fromFile: string, context: ResolutionContext): Node | null {
1178 const file = resolveImportPath(specifier, fromFile, 'python', context);
1179 if (!file || file === fromFile) return null;
1180 return context.getNodesInFile(file).find((n) => n.kind === 'file') ?? null;
1181}
1182
1183/**
1184 * The names `from <file> import *` binds: the string literals of the module's

Callers 1

Calls 2

resolveImportPathFunction · 0.85
getNodesInFileMethod · 0.65

Tested by

no test coverage detected