mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 09:35:40 -05:00
Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user