File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,8 @@ export namespace commands {
4040 export function setContext ( context : string , value : any ) {
4141 return executeCommand ( 'setContext' , context , value ) ;
4242 }
43+
44+ export function openFolder ( ur : vscode . Uri , options : { forceNewWindow ?: boolean , forceReuseWindow ?: boolean } ) {
45+ return executeCommand ( 'vscode.openFolder' , ur , options ) ;
46+ }
4347}
Original file line number Diff line number Diff line change 55
66import * as vscode from 'vscode' ;
77import { GitApiImpl } from './api/api1' ;
8+ import { commands } from './common/executeCommands' ;
89import Logger from './common/logger' ;
910import { ITelemetry } from './common/telemetry' ;
1011import { fromOpenIssueWebviewUri , fromOpenOrCheckoutPullRequestWebviewUri , UriHandlerPaths } from './common/uri' ;
@@ -148,7 +149,8 @@ export class UriHandler implements vscode.UriHandler {
148149 private async _savePendingCheckoutAndOpenFolder ( params : { owner : string ; repo : string ; pullRequestNumber : number } , folderUri : vscode . Uri ) : Promise < void > {
149150 const payload : PendingCheckoutPayload = { ...params , timestamp : Date . now ( ) } ;
150151 await this . _context . globalState . update ( PENDING_CHECKOUT_PULL_REQUEST_KEY , payload ) ;
151- await vscode . commands . executeCommand ( 'vscode.openFolder' , folderUri ) ;
152+ const isEmpty = vscode . workspace . workspaceFolders === undefined || vscode . workspace . workspaceFolders . length === 0 ;
153+ await commands . openFolder ( folderUri , { forceNewWindow : ! isEmpty , forceReuseWindow : isEmpty } ) ;
152154 }
153155
154156 private async _checkoutPullRequest ( uri : vscode . Uri ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments