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

Function luaBasenameIndex

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

Source from the content-addressed store, hash-verified

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