From f90e7ee8f6097c887d2da332fc6a9f438dc7c3b4 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 31 Aug 2018 11:59:44 +0200 Subject: [PATCH] mainThreadDebugService: proper listeners separation --- .../workbench/api/electron-browser/mainThreadDebugService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts index b5019456f93..f54eed8474e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -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(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);