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

Function codeLines

src/resolution/vbnet-receivers.ts:203–212  ·  view source on GitHub ↗

A file's lines as code (see vbCode), read once per file.

(file: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

201
202/** A file's lines as code (see vbCode), read once per file. */
203function codeLines(file: string, context: ResolutionContext): string[] {
204 let memo = VB_CODE_LINES.get(context);
205 if (!memo) VB_CODE_LINES.set(context, (memo = new Map()));
206 const hit = memo.get(file);
207 if (hit) return hit;
208 const lines = (context.getFileLines?.(file) ?? context.readFile(file)?.split(/\r?\n/) ?? []).map(vbCode);
209 if (memo.size >= 1024) memo.delete(memo.keys().next().value!);
210 memo.set(file, lines);
211 return lines;
212}
213
214interface VbPatterns {
215 /** The name standing where a binding names it — not as `name.Member` nor `name(args)`, which only use it. */

Callers 10

wordLinesFunction · 0.85
bindingsOfFunction · 0.85
supertypesOfFunction · 0.85
headerLinesFunction · 0.85
memberDeclaredTypeFunction · 0.85
declaredReturnTypeFunction · 0.85
readTypeParametersFunction · 0.85
readExtensionFunction · 0.85
isSharedMemberFunction · 0.85
takesNoArgumentsFunction · 0.85

Calls 7

mapMethod · 0.80
getFileLinesMethod · 0.80
nextMethod · 0.80
getMethod · 0.65
readFileMethod · 0.65
deleteMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected