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

Function luaBasenameIndex

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

Source from the content-addressed store, hash-verified

523const luaFileBasenameIndexes = new WeakMap<ResolutionContext, Map<string, string[]>>();
524
525function luaBasenameIndex(context: ResolutionContext): Map<string, string[]> {
526 let index = luaFileBasenameIndexes.get(context);
527 if (!index) {
528 index = new Map();
529 for (const f of context.getAllFiles()) {
530 const base = f.split('/').pop() ?? '';
531 const paths = index.get(base);
532 if (paths) paths.push(f);
533 else index.set(base, [f]);
534 }
535 luaFileBasenameIndexes.set(context, index);
536 }
537 return index;
538}
539
540function resolveCobolCopybook(
541 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