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

Method fill

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

Source from the content-addressed store, hash-verified

6280 .sort((a, b) => a - b);
6281 /** Source-ordered fill of whole parts, the overrunning one cut to a head window. */
6282 const fill = (room: number): { emit: ExploreLineRange[]; used: number } => {
6283 const emit: ExploreLineRange[] = [];
6284 let used = 0;
6285 for (const p of parts) {
6286 const join = emit.length > 0 ? GAP_MARKER.length : 0;
6287 if (used + join + p.text.length <= room) {
6288 emit.push(p.range);
6289 used += join + p.text.length;
6290 continue;
6291 }
6292 const first = emit.length === 0;
6293 const win = headWindowOf(
6294 p.range, Math.max(0, room - used - join), first ? MIN_WINDOW_LINES : 0);
6295 if (win && (first || win.end - win.start + 1 >= MIN_WINDOW_LINES)) {
6296 emit.push(win);
6297 used += join + renderSpan(win).length;
6298 }
6299 break;
6300 }
6301 return { emit, used };
6302 };
6303 let { emit, used } = fill(ceiling);
6304 const reached = () => (emit.length ? emit[emit.length - 1]!.end : 0);
6305 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