From 74aa227c098501446f578f742a4b52f730b974e1 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 18 Jun 2025 11:12:16 -0600 Subject: [PATCH] Wait for source maps when setting TypeScript breakpoints (#32954) Closes #ISSUE Release Notes: - debugger: Fix setting breakpoints in typescript code when debugging compiled javascript --- crates/dap_adapters/src/javascript.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/dap_adapters/src/javascript.rs b/crates/dap_adapters/src/javascript.rs index 838e39258e251f3ed728cf0339c7b627cb7958a8..e59fb101ff8ceb764ae6a7977f3b146d8e390f6a 100644 --- a/crates/dap_adapters/src/javascript.rs +++ b/crates/dap_adapters/src/javascript.rs @@ -99,6 +99,14 @@ impl JsDebugAdapter { configuration .entry("console") .or_insert("externalTerminal".into()); + + configuration.entry("sourceMaps").or_insert(true.into()); + configuration + .entry("pauseForSourceMap") + .or_insert(true.into()); + configuration + .entry("sourceMapRenames") + .or_insert(true.into()); } Ok(DebugAdapterBinary { @@ -269,6 +277,16 @@ impl DebugAdapter for JsDebugAdapter { "description": "Use JavaScript source maps if they exist", "default": true }, + "pauseForSourceMap": { + "type": "boolean", + "description": "Wait for source maps to load before setting breakpoints.", + "default": true + }, + "sourceMapRenames": { + "type": "boolean", + "description": "Whether to use the \"names\" mapping in sourcemaps.", + "default": true + }, "sourceMapPathOverrides": { "type": "object", "description": "Rewrites the locations of source files from what the sourcemap says to their locations on disk",