workspacesService.ts 1.1 KB
Newer Older
1 2 3 4 5
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

6
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
7
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
B
Benjamin Pasero 已提交
8
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
9
import { createChannelSender } from 'vs/base/parts/ipc/common/ipc';
10
import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron';
11

12
export class NativeWorkspacesService {
13

14
	_serviceBrand: undefined;
15

16
	constructor(
17 18
		@IMainProcessService mainProcessService: IMainProcessService,
		@IElectronService electronService: IElectronService
19
	) {
20
		return createChannelSender<IWorkspacesService>(mainProcessService.getChannel('workspaces'), { context: electronService.windowId });
21 22
	}
}
B
Benjamin Pasero 已提交
23

24
registerSingleton(IWorkspacesService, NativeWorkspacesService, true);