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

@@ -8,9 +8,8 @@ import URI from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base';
import Event, { Emitter } from 'vs/base/common/event';
import { asWinJsPromise } from 'vs/base/common/async';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/node/extHostCommands';
import { MainContext, MainThreadSCMShape, SCMRawResource } from './extHost.protocol';
import { MainContext, MainThreadSCMShape, SCMRawResource, IMainContext } from './extHost.protocol';
import * as vscode from 'vscode';
function getIconPath(decorations: vscode.SourceControlResourceThemableDecorations) {
@@ -277,10 +276,10 @@ export class ExtHostSCM {
get inputBox(): ExtHostSCMInputBox { return this._inputBox; }
constructor(
threadService: IThreadService,
mainContext: IMainContext,
private _commands: ExtHostCommands
) {
this._proxy = threadService.get(MainContext.MainThreadSCM);
this._proxy = mainContext.get(MainContext.MainThreadSCM);
this._inputBox = new ExtHostSCMInputBox(this._proxy);
_commands.registerArgumentProcessor({