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

Function addReg

src/resolution/callback-synthesizer.ts:256–261  ·  view source on GitHub ↗
(field: string | undefined, node: Node, absLine: number)

Source from the content-addressed store, hash-verified

254 const registrars = new Map<string, Array<{ node: Node; line: number }>>(); // field → registrar methods + append line
255
256 const addReg = (field: string | undefined, node: Node, absLine: number) => {
257 if (!field || /^\d+$/.test(field)) return; // `$0.append` mis-captures the `0`; the write-RE owns that field
258 const arr = registrars.get(field) ?? [];
259 if (!arr.some((r) => r.node.id === node.id)) arr.push({ node, line: absLine });
260 registrars.set(field, arr);
261 };
262
263 // Slices EVERY Swift/Kotlin method/function's source (no cheap name-gate), so
264 // on a repo with a huge file this is the heaviest synthesis pass — yield

Callers 1

closureCollectionEdgesFunction · 0.70

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected