workspacesService.ts 1.0 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/common/mainProcessService';
B
Benjamin Pasero 已提交
8
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
9
import { createChannelSender } from 'vs/base/parts/ipc/common/ipc';
10

11
export class NativeWorkspacesService {
12

13
	_serviceBrand: undefined;
14

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

22
registerSingleton(IWorkspacesService, NativeWorkspacesService, true);