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

Function pythonModuleFileNode

src/resolution/import-resolver.ts:1179–1183  ·  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

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