mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
refactor: increase context lines in NewUnifiedDiffStrategy
- Updated the maximum context lines from 3 to 6 in the parseUnifiedDiff method to provide more context around changes.
This commit is contained in:
@@ -5,7 +5,7 @@ import { DiffResult, DiffStrategy } from "../../types"
|
|||||||
|
|
||||||
export class NewUnifiedDiffStrategy implements DiffStrategy {
|
export class NewUnifiedDiffStrategy implements DiffStrategy {
|
||||||
private parseUnifiedDiff(diff: string): Diff {
|
private parseUnifiedDiff(diff: string): Diff {
|
||||||
const MAX_CONTEXT_LINES = 3; // Number of context lines to keep before/after changes
|
const MAX_CONTEXT_LINES = 6; // Number of context lines to keep before/after changes
|
||||||
const lines = diff.split('\n');
|
const lines = diff.split('\n');
|
||||||
const hunks: Hunk[] = [];
|
const hunks: Hunk[] = [];
|
||||||
let currentHunk: Hunk | null = null;
|
let currentHunk: Hunk | null = null;
|
||||||
@@ -49,9 +49,7 @@ export class NewUnifiedDiffStrategy implements DiffStrategy {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentHunk) {
|
if (!currentHunk) {continue};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract the complete indentation for each line
|
// Extract the complete indentation for each line
|
||||||
const content = line.slice(1); // Remove the diff marker
|
const content = line.slice(1); // Remove the diff marker
|
||||||
|
|||||||
Reference in New Issue
Block a user