66import { Event } from 'vs/base/common/event' ;
77import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows' ;
88import { MessageBoxOptions , MessageBoxReturnValue , shell , OpenDevToolsOptions , SaveDialogOptions , SaveDialogReturnValue , OpenDialogOptions , OpenDialogReturnValue , CrashReporterStartOptions , crashReporter , Menu , BrowserWindow , app } from 'electron' ;
9- import { INativeOpenInWindowOptions } from 'vs/platform/windows/node/window' ;
9+ import { INativeOpenWindowOptions } from 'vs/platform/windows/node/window' ;
1010import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService' ;
1111import { IOpenedWindow , OpenContext , IWindowOpenable , IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows' ;
1212import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs' ;
@@ -69,11 +69,17 @@ export class ElectronMainService implements AddFirstParameterToFunctions<IElectr
6969 return undefined ;
7070 }
7171
72- async openEmptyWindow ( windowId : number , options ?: IOpenEmptyWindowOptions ) : Promise < void > {
73- this . windowsMainService . openEmptyWindow ( OpenContext . API , options ) ;
72+ openWindow ( windowId : number , options ?: IOpenEmptyWindowOptions ) : Promise < void > ;
73+ openWindow ( windowId : number , toOpen : IWindowOpenable [ ] , options ?: INativeOpenWindowOptions ) : Promise < void > ;
74+ openWindow ( windowId : number , arg1 ?: IOpenEmptyWindowOptions | IWindowOpenable [ ] , arg2 ?: INativeOpenWindowOptions ) : Promise < void > {
75+ if ( Array . isArray ( arg1 ) ) {
76+ return this . doOpenWindow ( windowId , arg1 , arg2 ) ;
77+ }
78+
79+ return this . doOpenEmptyWindow ( windowId , arg1 ) ;
7480 }
7581
76- async openInWindow ( windowId : number , toOpen : IWindowOpenable [ ] , options : INativeOpenInWindowOptions = Object . create ( null ) ) : Promise < void > {
82+ private async doOpenWindow ( windowId : number , toOpen : IWindowOpenable [ ] , options : INativeOpenWindowOptions = Object . create ( null ) ) : Promise < void > {
7783 if ( toOpen . length > 0 ) {
7884 this . windowsMainService . open ( {
7985 context : OpenContext . API ,
@@ -91,6 +97,10 @@ export class ElectronMainService implements AddFirstParameterToFunctions<IElectr
9197 }
9298 }
9399
100+ private async doOpenEmptyWindow ( windowId : number , options ?: IOpenEmptyWindowOptions ) : Promise < void > {
101+ this . windowsMainService . openEmptyWindow ( OpenContext . API , options ) ;
102+ }
103+
94104 async toggleFullScreen ( windowId : number ) : Promise < void > {
95105 const window = this . windowsMainService . getWindowById ( windowId ) ;
96106 if ( window ) {
@@ -267,7 +277,7 @@ export class ElectronMainService implements AddFirstParameterToFunctions<IElectr
267277 }
268278 }
269279
270- async closeWorkpsace ( windowId : number ) : Promise < void > {
280+ async closeWorkspace ( windowId : number ) : Promise < void > {
271281 const window = this . windowsMainService . getWindowById ( windowId ) ;
272282 if ( window ) {
273283 return this . windowsMainService . closeWorkspace ( window ) ;
0 commit comments