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

Function resolveImportPath

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

Source from the content-addressed store, hash-verified

432}
433
434export function resolveImportPath(
435 importPath: string,
436 fromFile: string,
437 language: Language,
438 context: ResolutionContext
439): string | null {
440 let memo = importPathMemos.get(context);
441 if (!memo) {
442 memo = new Map();
443 importPathMemos.set(context, memo);
444 }
445 const key = `${language}\0${fromFile}\0${importPath}`;
446 const hit = memo.get(key);
447 if (hit !== undefined || memo.has(key)) return hit ?? null;
448 const resolved = resolveImportPathUncached(importPath, fromFile, language, context);
449 memo.set(key, resolved);
450 return resolved;
451}
452
453function resolveImportPathUncached(
454 importPath: string,

Callers 15

createContextMethod · 0.90
resolveModuleFileMethod · 0.90
couldNameAnyOfMethod · 0.90
isPythonProjectModuleMethod · 0.90
importedModuleFunction · 0.90
nextFunction · 0.90
importedFactsFunction · 0.90
importedFromFunction · 0.90
projectImportFunction · 0.90
importedFileFunction · 0.90
collectionOfFunction · 0.90
readBindingsFunction · 0.90

Calls 4

hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected