From 913bde7d3edfbd120bbceddf55dbb2985ecc4720 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 13 Feb 2020 10:40:31 -0600 Subject: [PATCH] fix debugger restart Fixes #95. Restarting the debugger was restarting the program multiple times and eventually getting stuck. This fixes it by reseting debugRestarting back to false to essentially make the restart a one-shot triggered event. --- src/extension.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index 153d34d..2f72cab 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -186,6 +186,7 @@ async function handleCustomDebugEvent(event: vscode.DebugSessionCustomEvent): Pr if (debugRestarting) { activeDebugSessions.add(event.session.id); event.session.customRequest('ev3devBrowser.debugger.thread', 'started'); + debugRestarting = false; } else { event.session.customRequest('ev3devBrowser.debugger.terminate'); } @@ -226,6 +227,7 @@ async function handleCustomDebugEvent(event: vscode.DebugSessionCustomEvent): Pr output.appendLine(`Restarting: ${command}`); output.appendLine('----------'); event.session.customRequest('ev3devBrowser.debugger.thread', 'started'); + debugRestarting = false; } else { event.session.customRequest('ev3devBrowser.debugger.terminate'); }