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

Function pythonModuleFileNode

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

1159
1160/** The file node of the module `specifier` names, as seen from `fromFile`. */
1161function pythonModuleFileNode(specifier: string, fromFile: string, context: ResolutionContext): Node | null {
1162 const file = resolveImportPath(specifier, fromFile, 'python', context);
1163 if (!file || file === fromFile) return null;
1164 return context.getNodesInFile(file).find((n) => n.kind === 'file') ?? null;
1165}
1166
1167/**
1168 * 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