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

Method fill

src/mcp/tools.ts:6338–6358  ·  view source on GitHub ↗
(room: number)

Source from the content-addressed store, hash-verified

6336 .sort((a, b) => a - b);
6337 /** Source-ordered fill of whole parts, the overrunning one cut to a head window. */
6338 const fill = (room: number): { emit: ExploreLineRange[]; used: number } => {
6339 const emit: ExploreLineRange[] = [];
6340 let used = 0;
6341 for (const p of parts) {
6342 const join = emit.length > 0 ? GAP_MARKER.length : 0;
6343 if (used + join + p.text.length <= room) {
6344 emit.push(p.range);
6345 used += join + p.text.length;
6346 continue;
6347 }
6348 const first = emit.length === 0;
6349 const win = headWindowOf(
6350 p.range, Math.max(0, room - used - join), first ? MIN_WINDOW_LINES : 0);
6351 if (win && (first || win.end - win.start + 1 >= MIN_WINDOW_LINES)) {
6352 emit.push(win);
6353 used += join + renderSpan(win).length;
6354 }
6355 break;
6356 }
6357 return { emit, used };
6358 };
6359 let { emit, used } = fill(ceiling);
6360 const reached = () => (emit.length ? emit[emit.length - 1]!.end : 0);
6361 if (focus.some((l) => l > reached())) {

Callers 13

synthesizeCallbackEdgesFunction · 0.80
computeGraphRelevanceMethod · 0.80
handleExploreMethod · 0.80
runBatchedMethod · 0.80
getExistingNodeIdsMethod · 0.80
marksMethod · 0.80
runGrammarFunction · 0.80
nodesAccessPathFunction · 0.80
makePsiLedMpegTsFunction · 0.80

Calls 1

pushMethod · 0.80

Tested by 3

nodesAccessPathFunction · 0.64
makePsiLedMpegTsFunction · 0.64
fakeTestingTBFunction · 0.64