Skip to content

Commit d13a934

Browse files
committed
Skip diff display for deleted files in code review preview
1 parent 44bd327 commit d13a934

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

  • packages/vscode/src/commands/apply-chat-response-command/utils/preview

packages/vscode/src/commands/apply-chat-response-command/utils/preview/vscode-ui.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ export const show_diff_with_actions = async (
3434

3535
const title = path.basename(prepared_file.reviewable_file.file_path)
3636

37-
await vscode.commands.executeCommand(
38-
'vscode.diff',
39-
left_doc_uri,
40-
right_doc_uri,
41-
title,
42-
{
43-
preview: false
44-
}
45-
)
37+
if (!prepared_file.reviewable_file.is_deleted) {
38+
await vscode.commands.executeCommand(
39+
'vscode.diff',
40+
left_doc_uri,
41+
right_doc_uri,
42+
title,
43+
{
44+
preview: false
45+
}
46+
)
47+
}
4648

4749
return new Promise<CodeReviewResult>((resolve) => {
4850
response_preview_promise_resolve = async (decision) => {

0 commit comments

Comments
 (0)