diff --git a/core/nextEdit/context/aggregateEdits.ts b/core/nextEdit/context/aggregateEdits.ts index 4443b1d9e..b4a9bbd9e 100644 --- a/core/nextEdit/context/aggregateEdits.ts +++ b/core/nextEdit/context/aggregateEdits.ts @@ -482,12 +482,13 @@ export class EditAggregator { return; } - const diff = createDiff( - beforeContent, - afterContent, - filePath, - DiffFormatType.Unified, - ); // Used for checks, not for final output + const diff = createDiff({ + beforeContent: beforeContent, + afterContent: afterContent, + filePath: filePath, + diffType: DiffFormatType.Unified, + contextLines: 3, + }); // Used for checks, not for final output // Skip diffs with too many changed lines const changedLineCount = this.countChangedLines(diff); diff --git a/core/nextEdit/context/processSmallEdit.ts b/core/nextEdit/context/processSmallEdit.ts index 18ed9d544..5824191b3 100644 --- a/core/nextEdit/context/processSmallEdit.ts +++ b/core/nextEdit/context/processSmallEdit.ts @@ -15,12 +15,13 @@ export const processSmallEdit = async ( ide: IDE, ) => { NextEditProvider.getInstance().addDiffToContext( - createDiff( - beforeAfterdiff.beforeContent, - beforeAfterdiff.afterContent, - beforeAfterdiff.filePath, - DiffFormatType.Unified, - ), + createDiff({ + beforeContent: beforeAfterdiff.beforeContent, + afterContent: beforeAfterdiff.afterContent, + filePath: beforeAfterdiff.filePath, + diffType: DiffFormatType.Unified, + contextLines: 3, // NOTE: This can change depending on experiments! + }), ); // Get the current context data from the most recent message