Add a mechanism to be a customer of the extension host (share lifecycle) and begin reducing usage of IThreadService

This commit is contained in:
Alex Dima
2017-08-15 18:26:35 +02:00
parent 8bad13987d
commit 20a45eef3a
27 changed files with 260 additions and 137 deletions

View File

@@ -5,15 +5,14 @@
'use strict';
import { TPromise } from 'vs/base/common/winjs.base';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { MainContext, MainThreadStorageShape } from './extHost.protocol';
import { MainContext, MainThreadStorageShape, IMainContext } from './extHost.protocol';
export class ExtHostStorage {
private _proxy: MainThreadStorageShape;
constructor(threadService: IThreadService) {
this._proxy = threadService.get(MainContext.MainThreadStorage);
constructor(mainContext: IMainContext) {
this._proxy = mainContext.get(MainContext.MainThreadStorage);
}
getValue<T>(shared: boolean, key: string, defaultValue?: T): TPromise<T> {