Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)

This commit is contained in:
Anthony Dresser
2019-09-24 21:36:17 -07:00
committed by GitHub
parent a29ae4d3b9
commit 6a6048d40f
541 changed files with 7045 additions and 7287 deletions

View File

@@ -17,6 +17,7 @@ import { normalizeDriveLetter } from 'vs/base/common/labels';
import { toSlashes } from 'vs/base/common/extpath';
import { FormattingOptions } from 'vs/base/common/jsonFormatter';
import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts';
import { IEnterWorkspaceResult } from 'vs/platform/windows/common/windows';
export const WORKSPACE_EXTENSION = 'code-workspace';
export const WORKSPACE_FILTER = [{ name: localize('codeWorkspace', "Code Workspace"), extensions: [WORKSPACE_EXTENSION] }];
@@ -97,6 +98,8 @@ export interface IWorkspacesService {
_serviceBrand: undefined;
enterWorkspace(path: URI): Promise<IEnterWorkspaceResult | undefined>;
createUntitledWorkspace(folders?: IWorkspaceFolderCreationData[], remoteAuthority?: string): Promise<IWorkspaceIdentifier>;
deleteUntitledWorkspace(workspace: IWorkspaceIdentifier): Promise<void>;

View File

@@ -8,10 +8,14 @@ import { IWorkspaceIdentifier, IWorkspaceFolderCreationData } from 'vs/platform/
import { IWorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
import { URI } from 'vs/base/common/uri';
import { Event } from 'vs/base/common/event';
import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows';
export class WorkspacesChannel implements IServerChannel {
constructor(private service: IWorkspacesMainService) { }
constructor(
private workspacesMainService: IWorkspacesMainService,
private windowsMainService: IWindowsMainService
) { }
listen<T>(_: unknown, event: string): Event<T> {
throw new Error(`Event not found: ${event}`);
@@ -32,14 +36,20 @@ export class WorkspacesChannel implements IServerChannel {
});
}
return this.service.createUntitledWorkspace(folders, remoteAuthority);
return this.workspacesMainService.createUntitledWorkspace(folders, remoteAuthority);
}
case 'deleteUntitledWorkspace': {
const w: IWorkspaceIdentifier = arg;
return this.service.deleteUntitledWorkspace({ id: w.id, configPath: URI.revive(w.configPath) });
const identifier: IWorkspaceIdentifier = arg;
return this.workspacesMainService.deleteUntitledWorkspace({ id: identifier.id, configPath: URI.revive(identifier.configPath) });
}
case 'getWorkspaceIdentifier': {
return this.service.getWorkspaceIdentifier(URI.revive(arg));
return this.workspacesMainService.getWorkspaceIdentifier(URI.revive(arg));
}
case 'enterWorkspace': {
const window = this.windowsMainService.getWindowById(arg[0]);
if (window) {
return this.windowsMainService.enterWorkspace(window, URI.revive(arg[1]));
}
}
}