Skip to content

Commit 379b7bc

Browse files
authored
Don't allow to create suggestions from PR diff (#6623)
Part of #6603
1 parent dddf922 commit 379b7bc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/commands.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,10 @@ ${contents}
12181218
return vscode.window.showErrorMessage(vscode.l10n.t('Current editor isn\'t a diff editor.'));
12191219
}
12201220

1221+
if (input.original.scheme !== Schemes.Git) {
1222+
return vscode.window.showErrorMessage(vscode.l10n.t('Converting changes to suggestions can only be done from a git diff, not a pull request diff'), { modal: true });
1223+
}
1224+
12211225
const editor = vscode.window.visibleTextEditors.find(editor => editor.document.uri.toString() === input.modified.toString());
12221226
if (!editor) {
12231227
return vscode.window.showErrorMessage(vscode.l10n.t('Unexpectedly unable to find the current modified editor.'));

src/common/uri.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,8 @@ export enum Schemes {
514514
MergeOutput = 'merge-output', // Merge output
515515
Notification = 'notification', // Notification tree items in the notification view
516516
NewIssue = 'newissue', // New issue file
517-
Repo = 'repo' // New issue file for passing data
517+
Repo = 'repo', // New issue file for passing data
518+
Git = 'git', // File content from the git extension
518519
}
519520

520521
export function resolvePath(from: vscode.Uri, to: string) {

0 commit comments

Comments
 (0)