Skip to content

Commit fb68b7d

Browse files
Copilotalexr00
andcommitted
Add additions/deletions properties to file change classes and display in tree view
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 1eb49df commit fb68b7d

File tree

3 files changed

+514
-469
lines changed

3 files changed

+514
-469
lines changed

src/common/diffHunk.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ export async function parseDiff(
349349
gitChangeType,
350350
review.filename,
351351
review.previous_filename,
352+
review.additions,
353+
review.deletions,
352354
),
353355
);
354356
continue;
@@ -363,7 +365,9 @@ export async function parseDiff(
363365
review.previous_filename,
364366
review.patch ?? '',
365367
diffHunks,
366-
review.blob_url
368+
review.blob_url,
369+
review.additions,
370+
review.deletions,
367371
),
368372
);
369373
}

src/common/file.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export interface SimpleFileChange {
2121
readonly fileName: string;
2222
readonly blobUrl: string | undefined;
2323
readonly diffHunks?: DiffHunk[];
24+
readonly additions?: number;
25+
readonly deletions?: number;
2426
}
2527

2628
export class InMemFileChange implements SimpleFileChange {
@@ -32,6 +34,8 @@ export class InMemFileChange implements SimpleFileChange {
3234
public readonly patch: string,
3335
public readonly diffHunks: DiffHunk[] | undefined,
3436
public readonly blobUrl: string,
37+
public readonly additions?: number,
38+
public readonly deletions?: number,
3539
) { }
3640
}
3741

@@ -42,5 +46,7 @@ export class SlimFileChange implements SimpleFileChange {
4246
public readonly status: GitChangeType,
4347
public readonly fileName: string,
4448
public readonly previousFileName: string | undefined,
49+
public readonly additions?: number,
50+
public readonly deletions?: number,
4551
) { }
4652
}

0 commit comments

Comments
 (0)