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

Function resolveImportPath

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

Source from the content-addressed store, hash-verified

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