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

Function resolveImportPath

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

Source from the content-addressed store, hash-verified

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