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

Function luaBasenameIndex

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

Source from the content-addressed store, hash-verified

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

Callers 1

resolveLuaRequireFunction · 0.85

Calls 3

getMethod · 0.65
getAllFilesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected