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

Function resolveImportPath

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

Source from the content-addressed store, hash-verified

112}
113
114export function resolveImportPath(
115 importPath: string,
116 fromFile: string,
117 language: Language,
118 context: ResolutionContext
119): string | null {
120 let memo = importPathMemos.get(context);
121 if (!memo) {
122 memo = new Map();
123 importPathMemos.set(context, memo);
124 }
125 const key = `${language}\0${fromFile}\0${importPath}`;
126 const hit = memo.get(key);
127 if (hit !== undefined || memo.has(key)) return hit ?? null;
128 const resolved = resolveImportPathUncached(importPath, fromFile, language, context);
129 memo.set(key, resolved);
130 return resolved;
131}
132
133function resolveImportPathUncached(
134 importPath: string,

Callers 5

resolution.test.tsFile · 0.90
resolveViaImportFunction · 0.85
findExportedSymbolWalkFunction · 0.85

Calls 4

hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected