mainThreadDebugService: proper listeners separation

This commit is contained in:
isidor
2018-08-31 11:59:44 +02:00
parent d97f06a1e2
commit f90e7ee8f6

View File

@@ -35,8 +35,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
) {
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDebugService);
this._toDispose = [];
this._toDispose.push(debugService.onWillNewSession(session => {
this._toDispose.push(debugService.onDidNewSession(session => {
this._proxy.$acceptDebugSessionStarted(<DebugSessionUUID>session.getId(), session.configuration.type, session.getName(false));
}));
this._toDispose.push(debugService.onWillNewSession(session => {
// Need to start listening early to new session events because a custom event can come while a session is initialising
this._toDispose.push(session.onDidCustomEvent(event => {
if (event && event.sessionId) {
this._proxy.$acceptDebugSessionCustomEvent(event.sessionId, session.configuration.type, session.configuration.name, event);