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

Function luaBasenameIndex

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

Source from the content-addressed store, hash-verified

196const luaFileBasenameIndexes = new WeakMap<ResolutionContext, Map<string, string[]>>();
197
198function luaBasenameIndex(context: ResolutionContext): Map<string, string[]> {
199 let index = luaFileBasenameIndexes.get(context);
200 if (!index) {
201 index = new Map();
202 for (const f of context.getAllFiles()) {
203 const base = f.split('/').pop() ?? '';
204 const paths = index.get(base);
205 if (paths) paths.push(f);
206 else index.set(base, [f]);
207 }
208 luaFileBasenameIndexes.set(context, index);
209 }
210 return index;
211}
212
213function resolveCobolCopybook(
214 member: string,

Callers 1

resolveLuaRequireFunction · 0.85

Calls 3

getMethod · 0.65
getAllFilesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected