From d860ec760361f68258d5665fc904c710c8d9a7bf Mon Sep 17 00:00:00 2001 From: Mickael Istria Date: Tue, 3 Oct 2023 23:19:33 +0200 Subject: [PATCH] Ensure configurationDone is sent even for non-debug As defined in spec, and as made mandatory (for the 1st time?) by vscode-js-debug. --- .../lsp4e/debug/debugmodel/DSPDebugTarget.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/DSPDebugTarget.java b/org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/DSPDebugTarget.java index 4e2a8863c..e12e9c82c 100644 --- a/org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/DSPDebugTarget.java +++ b/org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/DSPDebugTarget.java @@ -278,18 +278,19 @@ private CompletableFuture initialize(Map dspParameters, IProg } return q; }); - final CompletableFuture configurationDoneFuture; + CompletableFuture configurationDoneFuture = CompletableFuture.allOf(initialized, capabilitiesFuture).thenRun(() -> { + monitor.worked(10); + }); if (ILaunchManager.DEBUG_MODE.equals(launch.getLaunchMode())) { - var initializedAndCapable = CompletableFuture.allOf(initialized, capabilitiesFuture); - configurationDoneFuture = initializedAndCapable.thenRun(() -> { - monitor.worked(10); - }).thenCompose(v -> { + configurationDoneFuture = configurationDoneFuture.thenCompose(v -> { monitor.worked(10); monitor.subTask("Sending breakpoints"); breakpointManager = new DSPBreakpointManager(getBreakpointManager(), getDebugProtocolServer(), getCapabilities()); return breakpointManager.initialize(); - }).thenCompose(v -> { + }); + } + configurationDoneFuture = configurationDoneFuture.thenCompose(v -> { monitor.worked(30); monitor.subTask("Sending configuration done"); if (Boolean.TRUE.equals(getCapabilities().getSupportsConfigurationDoneRequest())) { @@ -297,10 +298,6 @@ private CompletableFuture initialize(Map dspParameters, IProg } return CompletableFuture.completedFuture(null); }); - } else { - // No debug mode, so just the launching itself happening - configurationDoneFuture = CompletableFuture.completedFuture(null); - } return CompletableFuture.allOf(launchAttachFuture, configurationDoneFuture); }