MCPcopy Index your code
hub / github.com/continuedev/continue / processFlexibleSizeGroup

Function processFlexibleSizeGroup

core/nextEdit/diff/diff.ts:421–439  ·  view source on GitHub ↗

* Process a changed area with flexible sizing.

(
  diffLines: DiffLine[],
  start: number,
  end: number,
  offset: number,
)

Source from the content-addressed store, hash-verified

419 * Process a changed area with flexible sizing.
420 */
421function processFlexibleSizeGroup(
422 diffLines: DiffLine[],
423 start: number,
424 end: number,
425 offset: number,
426): DiffGroup {
427 // Calculate the starting line in old content.
428 let oldContentLineStart = countOldContentLines(diffLines, 0, start - 1);
429
430 // Calculate the end line in old content.
431 let oldContentLineEnd =
432 oldContentLineStart + countOldContentLines(diffLines, start, end) - 1;
433
434 return {
435 startLine: oldContentLineStart + offset,
436 endLine: oldContentLineEnd + offset,
437 lines: diffLines.slice(start, end + 1),
438 };
439}

Callers 1

groupDiffLinesFunction · 0.85

Calls 1

countOldContentLinesFunction · 0.85

Tested by

no test coverage detected