Skip to content

Commit

Permalink
Ensure configurationDone is sent even for non-debug
Browse files Browse the repository at this point in the history
As defined in spec, and as made mandatory (for the 1st time?) by
vscode-js-debug.
  • Loading branch information
mickaelistria committed Oct 3, 2023
1 parent e2bb297 commit d860ec7
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,29 +278,26 @@ private CompletableFuture<?> initialize(Map<String, Object> dspParameters, IProg
}
return q;
});
final CompletableFuture<Void> configurationDoneFuture;
CompletableFuture<Void> 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())) {
return getDebugProtocolServer().configurationDone(new ConfigurationDoneArguments());
}
return CompletableFuture.completedFuture(null);
});
} else {
// No debug mode, so just the launching itself happening
configurationDoneFuture = CompletableFuture.completedFuture(null);
}
return CompletableFuture.allOf(launchAttachFuture, configurationDoneFuture);
}

Expand Down

0 comments on commit d860ec7

Please sign in to comment.