@@ -967,6 +967,22 @@ export function registerCommands(
967967 await openDescription ( telemetry , issueModel , descriptionNode , folderManager , revealDescription , ! ( argument instanceof RepositoryChangesNode ) , tree . notificationProvider ) ;
968968 }
969969
970+ async function checkoutChatSessionPullRequest ( argument : ChatSessionWithPR ) {
971+ const pr = argument . pullRequest ;
972+ if ( ! pr ) {
973+ Logger . warn ( `No pull request found in chat session` , logId ) ;
974+ return ;
975+ }
976+
977+ const folderManager = reposManager . getManagerForRepository ( pr . githubRepository . remote . owner , pr . githubRepository . remote . repositoryName ) ;
978+ if ( ! folderManager ) {
979+ Logger . warn ( `No folder manager found for pull request ${ pr . number } ` , logId ) ;
980+ return vscode . window . showErrorMessage ( vscode . l10n . t ( 'Unable to find repository for pull request #{0}' , pr . number . toString ( ) ) ) ;
981+ }
982+
983+ return switchToPr ( folderManager , pr , folderManager . repository , false ) ;
984+ }
985+
970986 async function closeChatSessionPullRequest ( argument : ChatSessionWithPR ) {
971987 const pr = argument . pullRequest ;
972988 if ( ! pr ) {
@@ -988,6 +1004,13 @@ export function registerCommands(
9881004 // TODO: show a progress icon until the cancelation is finished
9891005 }
9901006
1007+ context . subscriptions . push (
1008+ vscode . commands . registerCommand (
1009+ 'pr.checkoutChatSessionPullRequest' ,
1010+ checkoutChatSessionPullRequest
1011+ )
1012+ ) ;
1013+
9911014 context . subscriptions . push (
9921015 vscode . commands . registerCommand (
9931016 'pr.closeChatSessionPullRequest' ,
0 commit comments