提交 5a420476 编写于 作者: J Joao Moreno

ipc: remove vscode:showWindow

#10587
上级 1f00f9df
......@@ -231,15 +231,6 @@ export class WindowsManager implements IWindowsMainService, IWindowEventService
}
});
ipc.on('vscode:showWindow', (event, windowId: number) => {
this.logService.log('IPC#vscode:showWindow');
let vscodeWindow = this.getWindowById(windowId);
if (vscodeWindow) {
vscodeWindow.win.show();
}
});
ipc.on('vscode:setDocumentEdited', (event, windowId: number, edited: boolean) => {
this.logService.log('IPC#vscode:setDocumentEdited');
......
......@@ -31,6 +31,7 @@ export interface IWindowsService {
// TODO@joao: rename, shouldn't this be openWindow?
windowOpen(paths: string[], forceNewWindow?: boolean): TPromise<void>;
openNewWindow(): TPromise<void>;
showWindow(windowId: number): TPromise<void>;
}
export const IWindowService = createDecorator<IWindowService>('windowService');
......
......@@ -22,6 +22,7 @@ export interface IWindowsChannel extends IChannel {
call(command: 'focusWindow', arg: number): TPromise<void>;
call(command: 'windowOpen', arg: [string[], boolean]): TPromise<void>;
call(command: 'openNewWindow'): TPromise<void>;
call(command: 'showWindow', arg: number): TPromise<void>;
call(command: string, arg?: any): TPromise<any>;
}
......@@ -44,6 +45,7 @@ export class WindowsChannel implements IWindowsChannel {
case 'focusWindow': return this.service.focusWindow(arg);
case 'windowOpen': return this.service.windowOpen(arg[0], arg[1]);
case 'openNewWindow': return this.service.openNewWindow();
case 'showWindow': return this.service.showWindow(arg);
}
}
}
......@@ -105,4 +107,8 @@ export class WindowsChannelClient implements IWindowsService {
openNewWindow(): TPromise<void> {
return this.channel.call('openNewWindow');
}
showWindow(windowId: number): TPromise<void> {
return this.channel.call('showWindow', windowId);
}
}
\ No newline at end of file
......@@ -130,4 +130,14 @@ export class WindowsService implements IWindowsService {
this.windowsMainService.openNewWindow();
return TPromise.as(null);
}
showWindow(windowId: number): TPromise<void> {
const vscodeWindow = this.windowsMainService.getWindowById(windowId);
if (vscodeWindow) {
vscodeWindow.win.show();
}
return TPromise.as(null);
}
}
\ No newline at end of file
......@@ -80,19 +80,20 @@ export class CloseWindowAction extends Action {
export class SwitchWindow extends Action {
public static ID = 'workbench.action.switchWindow';
public static LABEL = nls.localize('switchWindow', "Switch Window");
static ID = 'workbench.action.switchWindow';
static LABEL = nls.localize('switchWindow', "Switch Window");
constructor(
id: string,
label: string,
@IWindowsService private windowsService: IWindowsService,
@IWindowIPCService private windowService: IWindowIPCService,
@IQuickOpenService private quickOpenService: IQuickOpenService
) {
super(id, label);
}
public run(): TPromise<boolean> {
run(): TPromise<boolean> {
const id = this.windowService.getWindowId();
ipc.send('vscode:switchWindow', id);
ipc.once('vscode:switchWindow', (event, workspaces) => {
......@@ -100,9 +101,7 @@ export class SwitchWindow extends Action {
return {
label: w.title,
description: (id === w.id) ? nls.localize('current', "Current Window") : void 0,
run: () => {
ipc.send('vscode:showWindow', w.id);
}
run: () => this.windowsService.showWindow(w.id)
};
});
this.quickOpenService.pick(picks, { placeHolder: nls.localize('switchWindowPlaceHolder', "Select a window") });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册