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

Function luaBasenameIndex

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

Source from the content-addressed store, hash-verified

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