aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorFilip Dutescu2023-02-20 04:00:00 +0000
committerGitHub2023-02-20 04:00:00 +0000
commite3765ac6d20195d2434c8274850247fe0a044da0 (patch)
treef221c9d2413bfc9a1618bb22ea51d5437d0e2eb7 /helix-term
parent31b0c75832c56179e9fcb2301f1e92ac2fa116ff (diff)
feat(dap): send Disconnect if Terminated event received (#5532)
Send a `Disconnect` DAP request if the `Terminated` event is received. According to the specification, if the debugging session was started by as `launch`, the debuggee should be terminated alongside the session. If instead the session was started as `attach`, it should not be disposed of. This default behaviour can be overriden if the `supportTerminateDebuggee` capability is supported by the adapter, through the `Disconnect` request `terminateDebuggee` argument, as described in [the specification][discon-spec]. This also implies saving the starting command for a debug sessions, in order to decide which behaviour should be used, as well as validating the capabilities of the adapter, in order to decide what the disconnect should do. An additional change made is handling of the `Exited` event, showing a message if the exit code is different than `0`, for the user to be aware off the termination failure. [discon-spec]: https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Disconnect Closes: #4674 Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands/dap.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index b3166e39..b30dc8c0 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -539,7 +539,7 @@ pub fn dap_variables(cx: &mut Context) {
pub fn dap_terminate(cx: &mut Context) {
let debugger = debugger!(cx.editor);
- let request = debugger.disconnect();
+ let request = debugger.disconnect(None);
dap_callback(cx.jobs, request, |editor, _compositor, _response: ()| {
// editor.set_error(format!("Failed to disconnect: {}", e));
editor.debugger = None;