diff options
author | Blaž Hrastnik | 2021-09-03 02:48:55 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-09-03 02:48:55 +0000 |
commit | 289303a30d8518890ae708b7fdd4996830df8642 (patch) | |
tree | 5df9fb531226f0ef44ea3b95e95aa07b2b43a3b4 /helix-term/src/commands/dap.rs | |
parent | 42f9718f55b58283253b2be85818a0aa0d5e3596 (diff) |
dap: small TODO
Diffstat (limited to 'helix-term/src/commands/dap.rs')
-rw-r--r-- | helix-term/src/commands/dap.rs | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index f40bdcbf..7618fca2 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -100,7 +100,7 @@ fn thread_picker(cx: &mut Context, callback_fn: impl Fn(&mut Editor, &dap::Threa let picker = Picker::new( true, threads, - |thread| thread.name.clone().into(), + |thread| thread.name.clone().into(), // TODO: include thread_states in the label move |editor, thread, _action| callback_fn(editor, thread), ); cx.push_layer(Box::new(picker)) @@ -300,25 +300,6 @@ pub fn dap_toggle_breakpoint(cx: &mut Context) { } } -pub fn dap_run(cx: &mut Context) { - let debugger = match &mut cx.editor.debugger { - Some(debugger) => debugger, - None => return, - }; - - if debugger.is_running { - cx.editor - .set_status("Debuggee is already running".to_owned()); - return; - } - let request = debugger.configuration_done(); - if let Err(e) = block_on(request) { - cx.editor.set_error(format!("Failed to run: {:?}", e)); - return; - } - debugger.is_running = true; -} - pub fn dap_continue(cx: &mut Context) { let debugger = match &mut cx.editor.debugger { Some(debugger) => debugger, @@ -340,10 +321,10 @@ pub fn dap_continue(cx: &mut Context) { pub fn dap_pause(cx: &mut Context) { thread_picker(cx, |editor, thread| { - let debugger = match &mut editor.debugger { - Some(debugger) => debugger, - None => return, - }; + let debugger = match &mut editor.debugger { + Some(debugger) => debugger, + None => return, + }; let request = debugger.pause(thread.id); // NOTE: we don't need to set active thread id here because DAP will emit a "stopped" event if let Err(e) = block_on(request) { |