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

Function resolveImportPath

src/resolution/import-resolver.ts:416–433  ·  view source on GitHub ↗
(
  importPath: string,
  fromFile: string,
  language: Language,
  context: ResolutionContext
)

Source from the content-addressed store, hash-verified

414}
415
416export function resolveImportPath(
417 importPath: string,
418 fromFile: string,
419 language: Language,
420 context: ResolutionContext
421): string | null {
422 let memo = importPathMemos.get(context);
423 if (!memo) {
424 memo = new Map();
425 importPathMemos.set(context, memo);
426 }
427 const key = `${language}\0${fromFile}\0${importPath}`;
428 const hit = memo.get(key);
429 if (hit !== undefined || memo.has(key)) return hit ?? null;
430 const resolved = resolveImportPathUncached(importPath, fromFile, language, context);
431 memo.set(key, resolved);
432 return resolved;
433}
434
435function resolveImportPathUncached(
436 importPath: string,

Callers 15

createContextMethod · 0.90
resolveModuleFileMethod · 0.90
couldNameAnyOfMethod · 0.90
isPythonProjectModuleMethod · 0.90
importedFactsFunction · 0.90
importedFromFunction · 0.90
projectImportFunction · 0.90
importedFileFunction · 0.90
readBindingsFunction · 0.90
handlerOfFunction · 0.90
localForwarderFunction · 0.90
linkTagsForFunction · 0.90

Calls 4

hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected