提交 3fa0bdbb 编写于 作者: B Benjamin Pasero

fix #49587

上级 8fbfcb1c
...@@ -716,7 +716,11 @@ export class WindowsManager implements IWindowsMainService { ...@@ -716,7 +716,11 @@ export class WindowsManager implements IWindowsMainService {
return window; return window;
} }
private doOpenFolderOrWorkspace(openConfig: IOpenConfiguration, folderOrWorkspace: IPathToOpen, openInNewWindow: boolean, filesToOpen: IPath[], filesToCreate: IPath[], filesToDiff: IPath[], filesToWait: IPathsToWaitFor, windowToUse?: ICodeWindow): ICodeWindow { private doOpenFolderOrWorkspace(openConfig: IOpenConfiguration, folderOrWorkspace: IPathToOpen, forceNewWindow: boolean, filesToOpen: IPath[], filesToCreate: IPath[], filesToDiff: IPath[], filesToWait: IPathsToWaitFor, windowToUse?: ICodeWindow): ICodeWindow {
if (!forceNewWindow && !windowToUse && typeof openConfig.contextWindowId === 'number') {
windowToUse = this.getWindowById(openConfig.contextWindowId); // fix for https://github.com/Microsoft/vscode/issues/49587
}
const browserWindow = this.openInBrowserWindow({ const browserWindow = this.openInBrowserWindow({
userEnv: openConfig.userEnv, userEnv: openConfig.userEnv,
cli: openConfig.cli, cli: openConfig.cli,
...@@ -727,7 +731,7 @@ export class WindowsManager implements IWindowsMainService { ...@@ -727,7 +731,7 @@ export class WindowsManager implements IWindowsMainService {
filesToCreate, filesToCreate,
filesToDiff, filesToDiff,
filesToWait, filesToWait,
forceNewWindow: openInNewWindow, forceNewWindow,
windowToUse windowToUse
}); });
......
...@@ -151,7 +151,7 @@ export interface IWindowsService { ...@@ -151,7 +151,7 @@ export interface IWindowsService {
toggleSharedProcess(): TPromise<void>; toggleSharedProcess(): TPromise<void>;
// Global methods // Global methods
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean; }): TPromise<void>; openWindow(windowId: number, paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean; }): TPromise<void>;
openNewWindow(): TPromise<void>; openNewWindow(): TPromise<void>;
showWindow(windowId: number): TPromise<void>; showWindow(windowId: number): TPromise<void>;
getWindows(): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderPath?: string; title: string; filename?: string; }[]>; getWindows(): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderPath?: string; title: string; filename?: string; }[]>;
...@@ -200,6 +200,7 @@ export interface IWindowService { ...@@ -200,6 +200,7 @@ export interface IWindowService {
getRecentlyOpened(): TPromise<IRecentlyOpened>; getRecentlyOpened(): TPromise<IRecentlyOpened>;
focusWindow(): TPromise<void>; focusWindow(): TPromise<void>;
closeWindow(): TPromise<void>; closeWindow(): TPromise<void>;
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean; }): TPromise<void>;
isFocused(): TPromise<boolean>; isFocused(): TPromise<boolean>;
setDocumentEdited(flag: boolean): TPromise<void>; setDocumentEdited(flag: boolean): TPromise<void>;
onWindowTitleDoubleClick(): TPromise<void>; onWindowTitleDoubleClick(): TPromise<void>;
......
...@@ -52,7 +52,7 @@ export interface IWindowsChannel extends IChannel { ...@@ -52,7 +52,7 @@ export interface IWindowsChannel extends IChannel {
call(command: 'onWindowTitleDoubleClick', arg: number): TPromise<void>; call(command: 'onWindowTitleDoubleClick', arg: number): TPromise<void>;
call(command: 'setDocumentEdited', arg: [number, boolean]): TPromise<void>; call(command: 'setDocumentEdited', arg: [number, boolean]): TPromise<void>;
call(command: 'quit'): TPromise<void>; call(command: 'quit'): TPromise<void>;
call(command: 'openWindow', arg: [string[], { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }]): TPromise<void>; call(command: 'openWindow', arg: [number, string[], { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }]): TPromise<void>;
call(command: 'openNewWindow'): TPromise<void>; call(command: 'openNewWindow'): TPromise<void>;
call(command: 'showWindow', arg: number): TPromise<void>; call(command: 'showWindow', arg: number): TPromise<void>;
call(command: 'getWindows'): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderPath?: string; title: string; filename?: string; }[]>; call(command: 'getWindows'): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderPath?: string; title: string; filename?: string; }[]>;
...@@ -131,7 +131,7 @@ export class WindowsChannel implements IWindowsChannel { ...@@ -131,7 +131,7 @@ export class WindowsChannel implements IWindowsChannel {
case 'unmaximizeWindow': return this.service.unmaximizeWindow(arg); case 'unmaximizeWindow': return this.service.unmaximizeWindow(arg);
case 'onWindowTitleDoubleClick': return this.service.onWindowTitleDoubleClick(arg); case 'onWindowTitleDoubleClick': return this.service.onWindowTitleDoubleClick(arg);
case 'setDocumentEdited': return this.service.setDocumentEdited(arg[0], arg[1]); case 'setDocumentEdited': return this.service.setDocumentEdited(arg[0], arg[1]);
case 'openWindow': return this.service.openWindow(arg[0], arg[1]); case 'openWindow': return this.service.openWindow(arg[0], arg[1], arg[2]);
case 'openNewWindow': return this.service.openNewWindow(); case 'openNewWindow': return this.service.openNewWindow();
case 'showWindow': return this.service.showWindow(arg); case 'showWindow': return this.service.showWindow(arg);
case 'getWindows': return this.service.getWindows(); case 'getWindows': return this.service.getWindows();
...@@ -309,8 +309,8 @@ export class WindowsChannelClient implements IWindowsService { ...@@ -309,8 +309,8 @@ export class WindowsChannelClient implements IWindowsService {
return this.channel.call('toggleSharedProcess'); return this.channel.call('toggleSharedProcess');
} }
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> { openWindow(windowId: number, paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
return this.channel.call('openWindow', [paths, options]); return this.channel.call('openWindow', [windowId, paths, options]);
} }
openNewWindow(): TPromise<void> { openNewWindow(): TPromise<void> {
......
...@@ -85,6 +85,10 @@ export class WindowService implements IWindowService { ...@@ -85,6 +85,10 @@ export class WindowService implements IWindowService {
return this.windowsService.saveAndEnterWorkspace(this.windowId, path); return this.windowsService.saveAndEnterWorkspace(this.windowId, path);
} }
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean; }): TPromise<void> {
return this.windowsService.openWindow(this.windowId, paths, options);
}
closeWindow(): TPromise<void> { closeWindow(): TPromise<void> {
return this.windowsService.closeWindow(this.windowId); return this.windowsService.closeWindow(this.windowId);
} }
......
...@@ -119,6 +119,7 @@ export interface IWindowsMainService { ...@@ -119,6 +119,7 @@ export interface IWindowsMainService {
export interface IOpenConfiguration { export interface IOpenConfiguration {
context: OpenContext; context: OpenContext;
contextWindowId?: number;
cli: ParsedArgs; cli: ParsedArgs;
userEnv?: IProcessEnvironment; userEnv?: IProcessEnvironment;
pathsToOpen?: string[]; pathsToOpen?: string[];
......
...@@ -360,7 +360,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable ...@@ -360,7 +360,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
return TPromise.as(null); return TPromise.as(null);
} }
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> { openWindow(windowId: number, paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
this.logService.trace('windowsService#openWindow'); this.logService.trace('windowsService#openWindow');
if (!paths || !paths.length) { if (!paths || !paths.length) {
return TPromise.as(null); return TPromise.as(null);
...@@ -368,6 +368,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable ...@@ -368,6 +368,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
this.windowsMainService.open({ this.windowsMainService.open({
context: OpenContext.API, context: OpenContext.API,
contextWindowId: windowId,
cli: this.environmentService.args, cli: this.environmentService.args,
pathsToOpen: paths, pathsToOpen: paths,
forceNewWindow: options && options.forceNewWindow, forceNewWindow: options && options.forceNewWindow,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import { Action } from 'vs/base/common/actions'; import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls'; import * as nls from 'vs/nls';
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; import { IWindowService } from 'vs/platform/windows/common/windows';
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
...@@ -228,7 +228,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action { ...@@ -228,7 +228,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
label: string, label: string,
@IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService,
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
@IWindowsService private windowsService: IWindowsService, @IWindowService private windowService: IWindowService,
@IWorkspacesService private workspacesService: IWorkspacesService @IWorkspacesService private workspacesService: IWorkspacesService
) { ) {
super(id, label); super(id, label);
...@@ -239,7 +239,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action { ...@@ -239,7 +239,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
return this.workspacesService.createWorkspace(folders).then(newWorkspace => { return this.workspacesService.createWorkspace(folders).then(newWorkspace => {
return this.workspaceEditingService.copyWorkspaceSettings(newWorkspace).then(() => { return this.workspaceEditingService.copyWorkspaceSettings(newWorkspace).then(() => {
return this.windowsService.openWindow([newWorkspace.configPath], { forceNewWindow: true }); return this.windowService.openWindow([newWorkspace.configPath], { forceNewWindow: true });
}); });
}); });
} }
......
...@@ -299,7 +299,7 @@ export class ResourcesDropHandler { ...@@ -299,7 +299,7 @@ export class ResourcesDropHandler {
// Open // Open
workspacesToOpen.then(workspaces => { workspacesToOpen.then(workspaces => {
this.windowsService.openWindow(workspaces, { forceReuseWindow: true }); this.windowService.openWindow(workspaces, { forceReuseWindow: true });
}); });
return true; return true;
......
...@@ -702,7 +702,6 @@ export abstract class BaseOpenRecentAction extends Action { ...@@ -702,7 +702,6 @@ export abstract class BaseOpenRecentAction extends Action {
constructor( constructor(
id: string, id: string,
label: string, label: string,
private windowsService: IWindowsService,
private windowService: IWindowService, private windowService: IWindowService,
private quickOpenService: IQuickOpenService, private quickOpenService: IQuickOpenService,
private contextService: IWorkspaceContextService, private contextService: IWorkspaceContextService,
...@@ -757,7 +756,7 @@ export abstract class BaseOpenRecentAction extends Action { ...@@ -757,7 +756,7 @@ export abstract class BaseOpenRecentAction extends Action {
const runPick = (path: string, isFile: boolean, context: IEntryRunContext) => { const runPick = (path: string, isFile: boolean, context: IEntryRunContext) => {
const forceNewWindow = context.keymods.ctrlCmd; const forceNewWindow = context.keymods.ctrlCmd;
this.windowsService.openWindow([path], { forceNewWindow, forceOpenWorkspaceAsFile: isFile }); this.windowService.openWindow([path], { forceNewWindow, forceOpenWorkspaceAsFile: isFile });
}; };
const workspacePicks: IFilePickOpenEntry[] = recentWorkspaces.map((workspace, index) => toPick(workspace, index === 0 ? { label: nls.localize('workspaces', "workspaces") } : void 0, isSingleFolderWorkspaceIdentifier(workspace) ? FileKind.FOLDER : FileKind.ROOT_FOLDER, this.environmentService, !this.isQuickNavigate() ? this.removeAction : void 0)); const workspacePicks: IFilePickOpenEntry[] = recentWorkspaces.map((workspace, index) => toPick(workspace, index === 0 ? { label: nls.localize('workspaces', "workspaces") } : void 0, isSingleFolderWorkspaceIdentifier(workspace) ? FileKind.FOLDER : FileKind.ROOT_FOLDER, this.environmentService, !this.isQuickNavigate() ? this.removeAction : void 0));
...@@ -812,7 +811,6 @@ export class OpenRecentAction extends BaseOpenRecentAction { ...@@ -812,7 +811,6 @@ export class OpenRecentAction extends BaseOpenRecentAction {
constructor( constructor(
id: string, id: string,
label: string, label: string,
@IWindowsService windowsService: IWindowsService,
@IWindowService windowService: IWindowService, @IWindowService windowService: IWindowService,
@IQuickOpenService quickOpenService: IQuickOpenService, @IQuickOpenService quickOpenService: IQuickOpenService,
@IWorkspaceContextService contextService: IWorkspaceContextService, @IWorkspaceContextService contextService: IWorkspaceContextService,
...@@ -820,7 +818,7 @@ export class OpenRecentAction extends BaseOpenRecentAction { ...@@ -820,7 +818,7 @@ export class OpenRecentAction extends BaseOpenRecentAction {
@IKeybindingService keybindingService: IKeybindingService, @IKeybindingService keybindingService: IKeybindingService,
@IInstantiationService instantiationService: IInstantiationService @IInstantiationService instantiationService: IInstantiationService
) { ) {
super(id, label, windowsService, windowService, quickOpenService, contextService, environmentService, keybindingService, instantiationService); super(id, label, windowService, quickOpenService, contextService, environmentService, keybindingService, instantiationService);
} }
protected isQuickNavigate(): boolean { protected isQuickNavigate(): boolean {
...@@ -836,7 +834,6 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction { ...@@ -836,7 +834,6 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
constructor( constructor(
id: string, id: string,
label: string, label: string,
@IWindowsService windowsService: IWindowsService,
@IWindowService windowService: IWindowService, @IWindowService windowService: IWindowService,
@IQuickOpenService quickOpenService: IQuickOpenService, @IQuickOpenService quickOpenService: IQuickOpenService,
@IWorkspaceContextService contextService: IWorkspaceContextService, @IWorkspaceContextService contextService: IWorkspaceContextService,
...@@ -844,7 +841,7 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction { ...@@ -844,7 +841,7 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
@IKeybindingService keybindingService: IKeybindingService, @IKeybindingService keybindingService: IKeybindingService,
@IInstantiationService instantiationService: IInstantiationService @IInstantiationService instantiationService: IInstantiationService
) { ) {
super(id, label, windowsService, windowService, quickOpenService, contextService, environmentService, keybindingService, instantiationService); super(id, label, windowService, quickOpenService, contextService, environmentService, keybindingService, instantiationService);
} }
protected isQuickNavigate(): boolean { protected isQuickNavigate(): boolean {
......
...@@ -39,7 +39,7 @@ import { IUntitledResourceInput } from 'vs/platform/editor/common/editor'; ...@@ -39,7 +39,7 @@ import { IUntitledResourceInput } from 'vs/platform/editor/common/editor';
import { IInstantiationService, ServicesAccessor, IConstructorSignature2 } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService, ServicesAccessor, IConstructorSignature2 } from 'vs/platform/instantiation/common/instantiation';
import { ITextModel } from 'vs/editor/common/model'; import { ITextModel } from 'vs/editor/common/model';
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IWindowService } from 'vs/platform/windows/common/windows';
import { COPY_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID } from 'vs/workbench/parts/files/electron-browser/fileCommands'; import { COPY_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID } from 'vs/workbench/parts/files/electron-browser/fileCommands';
import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
...@@ -1380,7 +1380,7 @@ export class ShowOpenedFileInNewWindow extends Action { ...@@ -1380,7 +1380,7 @@ export class ShowOpenedFileInNewWindow extends Action {
constructor( constructor(
id: string, id: string,
label: string, label: string,
@IWindowsService private windowsService: IWindowsService, @IWindowService private windowService: IWindowService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@INotificationService private notificationService: INotificationService, @INotificationService private notificationService: INotificationService,
) { ) {
...@@ -1390,7 +1390,7 @@ export class ShowOpenedFileInNewWindow extends Action { ...@@ -1390,7 +1390,7 @@ export class ShowOpenedFileInNewWindow extends Action {
public run(): TPromise<any> { public run(): TPromise<any> {
const fileResource = toResource(this.editorService.getActiveEditorInput(), { supportSideBySide: true, filter: Schemas.file /* todo@remote */ }); const fileResource = toResource(this.editorService.getActiveEditorInput(), { supportSideBySide: true, filter: Schemas.file /* todo@remote */ });
if (fileResource) { if (fileResource) {
this.windowsService.openWindow([fileResource.fsPath], { forceNewWindow: true, forceOpenWorkspaceAsFile: true }); this.windowService.openWindow([fileResource.fsPath], { forceNewWindow: true, forceOpenWorkspaceAsFile: true });
} else { } else {
this.notificationService.info(nls.localize('openFileToShowInNewWindow', "Open a file first to open in new window")); this.notificationService.info(nls.localize('openFileToShowInNewWindow', "Open a file first to open in new window"));
} }
......
...@@ -12,7 +12,7 @@ import * as labels from 'vs/base/common/labels'; ...@@ -12,7 +12,7 @@ import * as labels from 'vs/base/common/labels';
import URI from 'vs/base/common/uri'; import URI from 'vs/base/common/uri';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { toResource, IEditorCommandsContext } from 'vs/workbench/common/editor'; import { toResource, IEditorCommandsContext } from 'vs/workbench/common/editor';
import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows';
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
...@@ -77,8 +77,9 @@ export const REMOVE_ROOT_FOLDER_COMMAND_ID = 'removeRootFolder'; ...@@ -77,8 +77,9 @@ export const REMOVE_ROOT_FOLDER_COMMAND_ID = 'removeRootFolder';
export const REMOVE_ROOT_FOLDER_LABEL = nls.localize('removeFolderFromWorkspace', "Remove Folder from Workspace"); export const REMOVE_ROOT_FOLDER_LABEL = nls.localize('removeFolderFromWorkspace', "Remove Folder from Workspace");
export const openWindowCommand = (accessor: ServicesAccessor, paths: string[], forceNewWindow: boolean) => { export const openWindowCommand = (accessor: ServicesAccessor, paths: string[], forceNewWindow: boolean) => {
const windowsService = accessor.get(IWindowsService); const windowService = accessor.get(IWindowService);
windowsService.openWindow(paths, { forceNewWindow });
windowService.openWindow(paths, { forceNewWindow });
}; };
function save(resource: URI, isSaveAs: boolean, editorService: IWorkbenchEditorService, fileService: IFileService, untitledEditorService: IUntitledEditorService, function save(resource: URI, isSaveAs: boolean, editorService: IWorkbenchEditorService, fileService: IFileService, untitledEditorService: IUntitledEditorService,
......
...@@ -14,7 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti ...@@ -14,7 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { Position } from 'vs/platform/editor/common/editor'; import { Position } from 'vs/platform/editor/common/editor';
import { onUnexpectedError, isPromiseCanceledError } from 'vs/base/common/errors'; import { onUnexpectedError, isPromiseCanceledError } from 'vs/base/common/errors';
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; import { IWindowService } from 'vs/platform/windows/common/windows';
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
...@@ -221,7 +221,6 @@ class WelcomePage { ...@@ -221,7 +221,6 @@ class WelcomePage {
@IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IInstantiationService private instantiationService: IInstantiationService, @IInstantiationService private instantiationService: IInstantiationService,
@IWindowService private windowService: IWindowService, @IWindowService private windowService: IWindowService,
@IWindowsService private windowsService: IWindowsService,
@IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkspaceContextService private contextService: IWorkspaceContextService,
@IConfigurationService private configurationService: IConfigurationService, @IConfigurationService private configurationService: IConfigurationService,
@IEnvironmentService private environmentService: IEnvironmentService, @IEnvironmentService private environmentService: IEnvironmentService,
...@@ -317,7 +316,7 @@ class WelcomePage { ...@@ -317,7 +316,7 @@ class WelcomePage {
id: 'openRecentFolder', id: 'openRecentFolder',
from: telemetryFrom from: telemetryFrom
}); });
this.windowsService.openWindow([wsPath], { forceNewWindow: e.ctrlKey || e.metaKey }); this.windowService.openWindow([wsPath], { forceNewWindow: e.ctrlKey || e.metaKey });
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
}); });
......
...@@ -938,6 +938,10 @@ export class TestWindowService implements IWindowService { ...@@ -938,6 +938,10 @@ export class TestWindowService implements IWindowService {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
return TPromise.as(void 0);
}
closeWindow(): TPromise<void> { closeWindow(): TPromise<void> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
...@@ -1125,7 +1129,7 @@ export class TestWindowsService implements IWindowsService { ...@@ -1125,7 +1129,7 @@ export class TestWindowsService implements IWindowsService {
} }
// Global methods // Global methods
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> { openWindow(windowId: number, paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册