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

Function resolveImportPath

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

Source from the content-addressed store, hash-verified

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