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

@@ -4,14 +4,13 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { validateConstraint } from 'vs/base/common/types';
import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { TPromise } from 'vs/base/common/winjs.base';
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
import * as extHostTypeConverter from 'vs/workbench/api/node/extHostTypeConverters';
import { cloneAndChange } from 'vs/base/common/objects';
import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, ObjectIdentifier } from './extHost.protocol';
import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, ObjectIdentifier, IMainContext } from './extHost.protocol';
import { ExtHostHeapService } from 'vs/workbench/api/node/extHostHeapService';
import { isFalsyOrEmpty } from 'vs/base/common/arrays';
import * as modes from 'vs/editor/common/modes';
@@ -35,11 +34,11 @@ export class ExtHostCommands extends ExtHostCommandsShape {
private _argumentProcessors: ArgumentProcessor[] = [];
constructor(
threadService: IThreadService,
mainContext: IMainContext,
heapService: ExtHostHeapService
) {
super();
this._proxy = threadService.get(MainContext.MainThreadCommands);
this._proxy = mainContext.get(MainContext.MainThreadCommands);
this._converter = new CommandsConverter(this, heapService);
}