@@ -31,7 +31,7 @@ import { PullRequestModel } from './github/pullRequestModel';
3131import { PullRequestOverviewPanel } from './github/pullRequestOverview' ;
3232import { chooseItem } from './github/quickPicks' ;
3333import { RepositoriesManager } from './github/repositoriesManager' ;
34- import { getIssuesUrl , getPullsUrl , isInCodespaces , ISSUE_OR_URL_EXPRESSION , parseIssueExpressionOutput , vscodeDevPrLink } from './github/utils' ;
34+ import { codespacesPrLink , getIssuesUrl , getPullsUrl , isInCodespaces , ISSUE_OR_URL_EXPRESSION , parseIssueExpressionOutput , vscodeDevPrLink } from './github/utils' ;
3535import { OverviewContext } from './github/views' ;
3636import { isNotificationTreeItem , NotificationTreeItem } from './notifications/notificationItem' ;
3737import { NotificationsManager } from './notifications/notificationsManager' ;
@@ -725,6 +725,20 @@ export function registerCommands(
725725 return vscode . env . openExternal ( vscode . Uri . parse ( vscodeDevPrLink ( resolved . pr ) ) ) ;
726726 } ) ) ;
727727
728+ context . subscriptions . push ( vscode . commands . registerCommand ( 'pr.checkoutOnCodespacesFromDescription' , async ( context : OverviewContext | undefined ) => {
729+ if ( ! context ) {
730+ return vscode . window . showErrorMessage ( vscode . l10n . t ( 'No pull request context provided for checkout.' ) ) ;
731+ }
732+ const resolved = await resolvePr ( context ) ;
733+ if ( ! resolved ) {
734+ return vscode . window . showErrorMessage ( vscode . l10n . t ( 'Unable to resolve pull request for checkout.' ) ) ;
735+ }
736+ if ( ! resolved . pr . head ) {
737+ return vscode . window . showErrorMessage ( vscode . l10n . t ( 'Unable to checkout pull request: missing head branch information.' ) ) ;
738+ }
739+ return vscode . env . openExternal ( vscode . Uri . parse ( codespacesPrLink ( resolved . pr ) ) ) ;
740+ } ) ) ;
741+
728742 context . subscriptions . push ( vscode . commands . registerCommand ( 'pr.openSessionLogFromDescription' , async ( context : SessionLinkInfo | undefined ) => {
729743 if ( ! context ) {
730744 return vscode . window . showErrorMessage ( vscode . l10n . t ( 'No pull request context provided for checkout.' ) ) ;
0 commit comments