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

Function open

src/ui-server/api/program.ts:308–316  ·  view source on GitHub ↗

* Whether this reading may open a function's body here: not if it is already * open on the way in (a helper that calls itself), not if it has been read * somewhere else in this picture, and not past the depth or the size the * reading allows.

(fn: string, path: readonly string[], state: Reading)

Source from the content-addressed store, hash-verified

306 * reading allows.
307 */
308function open(fn: string, path: readonly string[], state: Reading): boolean {
309 if (path.includes(fn) || state.read.has(fn)) return false;
310 if (path.length >= MAX_INLINE || state.items >= MAX_ITEMS) {
311 state.truncated++;
312 return false;
313 }
314 state.read.add(fn);
315 return true;
316}
317
318/**
319 * Put an item in its block, opening the run it belongs to: work registered to

Callers 4

itemForFunction · 0.70
openProjectRootMethod · 0.50
acquireProjectFunction · 0.50
constructorMethod · 0.50

Calls 2

hasMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected