Skip to content

Commit 70f3a09

Browse files
committed
1 parent 208a139 commit 70f3a09

10 files changed

Lines changed: 15 additions & 11 deletions

File tree

src/vs/code/electron-main/windows.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,9 +1611,9 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
16111611
return getLastActiveWindow(WindowsManager.WINDOWS.filter(window => window.remoteAuthority === remoteAuthority));
16121612
}
16131613

1614-
openEmptyWindow(context: OpenContext, options?: { reuse?: boolean }): ICodeWindow[] {
1614+
openEmptyWindow(context: OpenContext, options?: { reuse?: boolean, remoteAuthority?: string }): ICodeWindow[] {
16151615
let cli = this.environmentService.args;
1616-
const remote = undefined;
1616+
const remote = options && options.remoteAuthority;
16171617
if (cli && (cli.remote !== remote)) {
16181618
cli = { ...cli, remote };
16191619
}

src/vs/platform/electron/electron-main/electronMainService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ElectronMainService {
2525
return this.windowsMainService.getWindowCount();
2626
}
2727

28-
async openEmptyWindow(windowId: number, options?: { reuse?: boolean }): Promise<void> {
28+
async openEmptyWindow(windowId: number, options?: { reuse?: boolean, remoteAuthority?: string }): Promise<void> {
2929
this.windowsMainService.openEmptyWindow(OpenContext.API, options);
3030
}
3131

src/vs/platform/electron/node/electron.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface IElectronService {
1515

1616
// Window
1717
windowCount(): Promise<number>;
18-
openEmptyWindow(options?: { reuse?: boolean }): Promise<void>;
18+
openEmptyWindow(options?: { reuse?: boolean, remoteAuthority?: string }): Promise<void>;
1919
toggleFullScreen(): Promise<void>;
2020

2121
// Dialogs

src/vs/platform/windows/electron-main/windows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export interface IWindowsMainService {
108108
focusLastActive(cli: ParsedArgs, context: OpenContext): ICodeWindow;
109109
getLastActiveWindow(): ICodeWindow | undefined;
110110
waitForWindowCloseOrLoad(windowId: number): Promise<void>;
111-
openEmptyWindow(context: OpenContext, options?: { reuse?: boolean }): ICodeWindow[];
111+
openEmptyWindow(context: OpenContext, options?: { reuse?: boolean, remoteAuthority?: string}): ICodeWindow[];
112112
openNewTabbedWindow(context: OpenContext): ICodeWindow[];
113113
openExternal(url: string): Promise<boolean>;
114114
sendToFocused(channel: string, ...args: any[]): void;

src/vs/workbench/api/common/apiCommands.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ CommandsRegistry.registerCommand({
7070

7171
interface INewWindowAPICommandOptions {
7272
reuseWindow?: boolean;
73+
remoteAuthority?: string;
7374
}
7475

7576
export class NewWindowAPICommand {
7677
public static ID = 'vscode.newWindow';
7778
public static execute(executor: ICommandsExecutor, options?: INewWindowAPICommandOptions): Promise<any> {
78-
return executor.executeCommand('_files.newWindow', options);
79+
return executor.executeCommand('_files.newWindow', {
80+
reuse: options && options.reuseWindow,
81+
remoteAuthority: options && options.remoteAuthority
82+
});
7983
}
8084
}
8185
CommandsRegistry.registerCommand({

src/vs/workbench/contrib/files/browser/fileCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const openWindowCommand = (accessor: ServicesAccessor, urisToOpen: IURITo
9898
}
9999
};
100100

101-
export const newWindowCommand = (accessor: ServicesAccessor, options?: { reuse?: boolean }) => {
101+
export const newWindowCommand = (accessor: ServicesAccessor, options?: { reuse?: boolean, remoteAuthority?: string }) => {
102102
const hostService = accessor.get(IHostService);
103103
hostService.openEmptyWindow(options);
104104
};

src/vs/workbench/services/host/browser/browserHostService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class BrowserHostService implements IHostService {
1717

1818
readonly windowCount = Promise.resolve(1);
1919

20-
async openEmptyWindow(options?: { reuse?: boolean }): Promise<void> {
20+
async openEmptyWindow(options?: { reuse?: boolean, remoteAuthority?: string }): Promise<void> {
2121
// TODO@Ben delegate to embedder
2222
const targetHref = `${document.location.origin}${document.location.pathname}?ew=true`;
2323
if (options && options.reuse) {

src/vs/workbench/services/host/browser/host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface IHostService {
2222
* Opens an empty window. The optional parameter allows to define if
2323
* a new window should open or the existing one change to an empty.
2424
*/
25-
openEmptyWindow(options?: { reuse?: boolean }): Promise<void>;
25+
openEmptyWindow(options?: { reuse?: boolean, remoteAuthority?: string }): Promise<void>;
2626

2727
toggleFullScreen(): Promise<void>;
2828

src/vs/workbench/services/host/electron-browser/desktopHostService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class DesktopHostService implements IHostService {
1717

1818
get windowCount() { return this.electronService.windowCount(); }
1919

20-
openEmptyWindow(options?: { reuse?: boolean }): Promise<void> {
20+
openEmptyWindow(options?: { reuse?: boolean, remoteAuthority?: string }): Promise<void> {
2121
return this.electronService.openEmptyWindow(options);
2222
}
2323

src/vs/workbench/test/workbenchTestServices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ export class TestHostService implements IHostService {
15201520
restart(): Promise<void> { return Promise.resolve(); }
15211521
reload(): Promise<void> { return Promise.resolve(); }
15221522

1523-
openEmptyWindow(options?: { reuse?: boolean }): Promise<void> { return Promise.resolve(); }
1523+
openEmptyWindow(options?: { reuse?: boolean, remoteAuthority?: string }): Promise<void> { return Promise.resolve(); }
15241524

15251525
toggleFullScreen(): Promise<void> { return Promise.resolve(); }
15261526
}

0 commit comments

Comments
 (0)