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

Function luaBasenameIndex

src/resolution/import-resolver.ts:297–310  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

295const luaFileBasenameIndexes = new WeakMap<ResolutionContext, Map<string, string[]>>();
296
297function luaBasenameIndex(context: ResolutionContext): Map<string, string[]> {
298 let index = luaFileBasenameIndexes.get(context);
299 if (!index) {
300 index = new Map();
301 for (const f of context.getAllFiles()) {
302 const base = f.split('/').pop() ?? '';
303 const paths = index.get(base);
304 if (paths) paths.push(f);
305 else index.set(base, [f]);
306 }
307 luaFileBasenameIndexes.set(context, index);
308 }
309 return index;
310}
311
312function resolveCobolCopybook(
313 member: string,

Callers 1

resolveLuaRequireFunction · 0.85

Calls 4

pushMethod · 0.80
getMethod · 0.65
getAllFilesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected