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

Function pythonImportKeys

src/resolution/name-matcher.ts:604–606  ·  view source on GitHub ↗

Distinct sources a file imports `name` from, at any scope (`from a import x` → `a:x`).

(name: string, filePath: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

602
603/** Distinct sources a file imports `name` from, at any scope (`from a import x` → `a:x`). */
604function pythonImportKeys(name: string, filePath: string, context: ResolutionContext): Set<string> {
605 return pythonNameScan(context, `imports\0${filePath}\0${name}`, () => scanPythonImportKeys(name, filePath, context));
606}
607
608const PYTHON_NAME_SCANS = new WeakMap<ResolutionContext, Map<string, unknown>>();
609/** Per-file, per-name scans are shared by every ref in the file; cleared with the other memos on sync. */

Callers 1

matchMemberFunctionRefFunction · 0.85

Calls 2

pythonNameScanFunction · 0.85
scanPythonImportKeysFunction · 0.85

Tested by

no test coverage detected