mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Split up ext host <-> main thread communication to separate files
This commit is contained in:
32
src/vs/workbench/api/node/mainThreadConfiguration.ts
Normal file
32
src/vs/workbench/api/node/mainThreadConfiguration.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostConfiguration} from './extHostConfiguration';
|
||||
|
||||
export class MainThreadConfiguration {
|
||||
|
||||
private _configurationService: IConfigurationService;
|
||||
private _toDispose: IDisposable;
|
||||
private _proxy: ExtHostConfiguration;
|
||||
|
||||
constructor(@IConfigurationService configurationService: IConfigurationService,
|
||||
@IThreadService threadService: IThreadService) {
|
||||
|
||||
this._configurationService = configurationService;
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostConfiguration);
|
||||
|
||||
this._toDispose = this._configurationService.onDidUpdateConfiguration(event => this._proxy.$acceptConfigurationChanged(event.config));
|
||||
this._proxy.$acceptConfigurationChanged(this._configurationService.getConfiguration());
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user