From 4c6f4e066b6da55b22bccc8fb3725dd3db278c20 Mon Sep 17 00:00:00 2001 From: Vladimir Popov Date: Mon, 11 Apr 2022 23:35:57 +0700 Subject: [PATCH] Delete debug session in `$sessionDidDestroy` instead of `$terminateDebugSession` (#10954) Signed-off-by: Vladimir Popov --- packages/plugin-ext/src/plugin/node/debug/debug.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-ext/src/plugin/node/debug/debug.ts b/packages/plugin-ext/src/plugin/node/debug/debug.ts index 152e6f4bca588..28d700bf95cb2 100644 --- a/packages/plugin-ext/src/plugin/node/debug/debug.ts +++ b/packages/plugin-ext/src/plugin/node/debug/debug.ts @@ -233,6 +233,7 @@ export class DebugExtImpl implements DebugExt { const session = this.sessions.get(sessionId); if (session) { this.onDidTerminateDebugSessionEmitter.fire(session); + this.sessions.delete(sessionId); } } @@ -322,7 +323,6 @@ export class DebugExtImpl implements DebugExt { const debugAdapterSession = this.sessions.get(sessionId); if (debugAdapterSession) { await debugAdapterSession.stop(); - this.sessions.delete(sessionId); } }