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

@@ -12,8 +12,7 @@ import { asWinJsPromise } from 'vs/base/common/async';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import * as TaskSystem from 'vs/workbench/parts/tasks/common/tasks';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { MainContext, MainThreadTaskShape, ExtHostTaskShape } from 'vs/workbench/api/node/extHost.protocol';
import { MainContext, MainThreadTaskShape, ExtHostTaskShape, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import * as types from 'vs/workbench/api/node/extHostTypes';
import * as vscode from 'vscode';
@@ -402,9 +401,9 @@ export class ExtHostTask extends ExtHostTaskShape {
private _handleCounter: number;
private _handlers: Map<number, HandlerData>;
constructor(threadService: IThreadService) {
constructor(mainContext: IMainContext) {
super();
this._proxy = threadService.get(MainContext.MainThreadTask);
this._proxy = mainContext.get(MainContext.MainThreadTask);
this._handleCounter = 0;
this._handlers = new Map<number, HandlerData>();
};