From 26dee49dc991d671fc3cbf7993ff193859edea4e Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sat, 21 Aug 2021 20:33:56 +0300 Subject: Add command to detach debugger --- helix-term/src/commands.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'helix-term/src/commands.rs') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 34a146c2..f7317f7a 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -306,6 +306,7 @@ impl Command { dap_toggle_breakpoint, "Toggle breakpoint", dap_start, "Start debug session", dap_run, "Begin program execution", + dap_terminate, "End debug session", suspend, "Suspend" ); } @@ -4321,3 +4322,12 @@ fn dap_run(cx: &mut Context) { let _ = block_on(request).unwrap(); } } + +fn dap_terminate(cx: &mut Context) { + use helix_lsp::block_on; + + if let Some(debugger) = &mut cx.editor.debugger { + let request = debugger.disconnect(); + let _ = block_on(request).unwrap(); + } +} -- cgit v1.2.3-70-g09d2