Skip to content

Commit

Permalink
"Go to Next Diff in Pull Request" command error (#6563)
Browse files Browse the repository at this point in the history
* "Go to Next Diff in Pull Request" command fails with error
Fixes #6237

* Switch to info message
  • Loading branch information
alexr00 authored Dec 18, 2024
1 parent 866c62b commit 9f6b715
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ ${contents}
}

const editorUri = editor.document.uri;
if (input.original.scheme !== Schemes.Review) {
if ((input.original.scheme !== Schemes.Review) && (input.original.scheme !== Schemes.Pr)) {
return vscode.window.showErrorMessage(vscode.l10n.t('Current file isn\'t a pull request diff.'));
}

Expand All @@ -1559,6 +1559,10 @@ ${contents}
}
}

if (input.original.scheme === Schemes.Pr) {
return vscode.window.showInformationMessage(vscode.l10n.t('No more diffs in this file. Check out the pull request to use this command across files.'));
}

// There is no new range to reveal, time to go to the next file.
const folderManager = reposManager.getManagerForFile(editorUri);
if (!folderManager) {
Expand Down

0 comments on commit 9f6b715

Please sign in to comment.