More adoption of @extHostNamedCustomer

This commit is contained in:
Alex Dima
2017-08-16 09:54:08 +02:00
parent f91db52096
commit 159de8236e
11 changed files with 55 additions and 46 deletions

View File

@@ -7,22 +7,23 @@
import URI from 'vs/base/common/uri';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IDebugService, IConfig } from 'vs/workbench/parts/debug/common/debug';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { TPromise } from 'vs/base/common/winjs.base';
import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID } from '../node/extHost.protocol';
import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
@extHostNamedCustomer<MainThreadDebugServiceShape>(MainContext.MainThreadDebugService)
export class MainThreadDebugService extends MainThreadDebugServiceShape {
private _proxy: ExtHostDebugServiceShape;
private _toDispose: IDisposable[];
constructor(
@IThreadService threadService: IThreadService,
extHostContext: IExtHostContext,
@IDebugService private debugService: IDebugService
) {
super();
this._proxy = threadService.get(ExtHostContext.ExtHostDebugService);
this._proxy = extHostContext.get(ExtHostContext.ExtHostDebugService);
this._toDispose = [];
this._toDispose.push(debugService.onDidNewProcess(proc => this._proxy.$acceptDebugSessionStarted(<DebugSessionUUID>proc.getId(), proc.configuration.type, proc.getName(false))));
this._toDispose.push(debugService.onDidEndProcess(proc => this._proxy.$acceptDebugSessionTerminated(<DebugSessionUUID>proc.getId(), proc.configuration.type, proc.getName(false))));