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:
Daniel Riccio
2025-01-10 17:35:22 -05:00
parent 6d68edef3e
commit 0d004b5c77

View File

@@ -5,7 +5,7 @@ import { DiffResult, DiffStrategy } from "../../types"
export class NewUnifiedDiffStrategy implements DiffStrategy {
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 hunks: Hunk[] = [];
let currentHunk: Hunk | null = null;
@@ -49,9 +49,7 @@ export class NewUnifiedDiffStrategy implements DiffStrategy {
continue;
}
if (!currentHunk) {
continue;
}
if (!currentHunk) {continue};
// Extract the complete indentation for each line
const content = line.slice(1); // Remove the diff marker