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

Function luaBasenameIndex

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

Source from the content-addressed store, hash-verified

505const luaFileBasenameIndexes = new WeakMap<ResolutionContext, Map<string, string[]>>();
506
507function luaBasenameIndex(context: ResolutionContext): Map<string, string[]> {
508 let index = luaFileBasenameIndexes.get(context);
509 if (!index) {
510 index = new Map();
511 for (const f of context.getAllFiles()) {
512 const base = f.split('/').pop() ?? '';
513 const paths = index.get(base);
514 if (paths) paths.push(f);
515 else index.set(base, [f]);
516 }
517 luaFileBasenameIndexes.set(context, index);
518 }
519 return index;
520}
521
522function resolveCobolCopybook(
523 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