From 6ea0f22932f2387e7b48eaf43ec576d31125d564 Mon Sep 17 00:00:00 2001 From: Florian Richter <77792630+mvtec-richter@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:39:19 +0100 Subject: [PATCH] Fix updating breakpoints when debugging starts (#14645) Previously, when starting to debug, the breakpoints did not move to valid lines. The breakpoints were send to the debug adapter before configurationDone and some debug adapters (e. g. python) return updated positions directly. The updates were not visible in the editor, because the connection was not marked as initialized yet and events were ignored. The updates became only visible, when changing breakpoints later. This commit fixes this. Fixes #14096 Signed-off-by: Florian Richter --- packages/debug/src/browser/debug-session.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/debug/src/browser/debug-session.tsx b/packages/debug/src/browser/debug-session.tsx index d1494eac6e440..5fefa1bfd3ea2 100644 --- a/packages/debug/src/browser/debug-session.tsx +++ b/packages/debug/src/browser/debug-session.tsx @@ -377,11 +377,12 @@ export class DebugSession implements CompositeTreeElement { } this.breakpoints.setExceptionBreakpoints(exceptionBreakpoints); } + // mark as initialized, so updated breakpoints are shown in editor + this.initialized = true; await this.updateBreakpoints({ sourceModified: false }); if (this.capabilities.supportsConfigurationDoneRequest) { await this.sendRequest('configurationDone', {}); } - this.initialized = true; await this.updateThreads(undefined); }