@@ -43,7 +43,9 @@ class Extension {
43
43
vscode . commands . registerCommand ( 'vscode-github.createPullRequest' , this . wrapCommand ( this . createPullRequest ) ) ,
44
44
vscode . commands . registerCommand ( 'vscode-github.checkoutPullRequests' ,
45
45
this . wrapCommand ( this . checkoutPullRequests ) ) ,
46
- vscode . commands . registerCommand ( 'vscode-github.browserPullRequest' , this . wrapCommand ( this . browserPullRequest ) ) ,
46
+ vscode . commands . registerCommand ( 'vscode-github.browserSimplePullRequest' ,
47
+ this . wrapCommand ( this . browseSimplePullRequest ) ) ,
48
+ vscode . commands . registerCommand ( 'vscode-github.browserPullRequest' , this . wrapCommand ( this . browsePullRequest ) ) ,
47
49
vscode . commands . registerCommand ( 'vscode-github.mergePullRequest' , this . wrapCommand ( this . mergePullRequest ) ) ,
48
50
vscode . commands . registerCommand ( 'vscode-github.addAssignee' , this . wrapCommand ( this . addAssignee ) ) ,
49
51
vscode . commands . registerCommand ( 'vscode-github.removeAssignee' , this . wrapCommand ( this . removeAssignee ) ) ,
@@ -231,7 +233,18 @@ class Extension {
231
233
} ) ;
232
234
}
233
235
234
- private async browserPullRequest ( ) : Promise < void > {
236
+ private async browseSimplePullRequest ( ) : Promise < void > {
237
+ await this . withinProgressUI ( async ( ) => {
238
+ const pullRequest = await this . githubManager . getPullRequestForCurrentBranch ( ) ;
239
+ if ( pullRequest ) {
240
+ await vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( pullRequest . html_url ) ) ;
241
+ } else {
242
+ vscode . window . showInformationMessage ( 'No pull request for current branch found' ) ;
243
+ }
244
+ } ) ;
245
+ }
246
+
247
+ private async browsePullRequest ( ) : Promise < void > {
235
248
this . selectPullRequest ( pullRequest => {
236
249
vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( pullRequest . html_url ) ) ;
237
250
} ) ;
0 commit comments