@@ -303,8 +303,7 @@ impl Command {
303 select_textobject_around, "Select around object",
303 select_textobject_around, "Select around object",
304 select_textobject_inner, "Select inside object",
304 select_textobject_inner, "Select inside object",
305 dap_toggle_breakpoint, "Toggle breakpoint",
305 dap_toggle_breakpoint, "Toggle breakpoint",
306− dap_init, "Start debug session",
306+ dap_start, "Start debug session",
307− dap_launch, "Launch debugger",
308 dap_run, "Begin program execution",
307 dap_run, "Begin program execution",
309 suspend, "Suspend"
308 suspend, "Suspend"
@@ -4245,9 +4244,11 @@ fn suspend(_cx: &mut Context) {
4248−fn dap_init(cx: &mut Context) {
4247+fn dap_start(cx: &mut Context) {
4249 use helix_dap::Client;
4248 use helix_dap::Client;
4250 use helix_lsp::block_on;
4249 use helix_lsp::block_on;
4250+ use serde_json::to_value;
4251 let (_, _doc) = current!(cx.editor);
4252 let (_, _doc) = current!(cx.editor);
4253 // look up config for filetype
4254 // look up config for filetype
@@ -4259,6 +4260,13 @@ fn dap_init(cx: &mut Context) {
4259 let request = debugger.initialize("go".to_owned());
4260 let request = debugger.initialize("go".to_owned());
4260 let _ = block_on(request).unwrap();
4261 let _ = block_on(request).unwrap();
4263+ let mut args = HashMap::new();
4264+ args.insert("mode", "debug");
4265+ args.insert("program", "main.go");
4267+ let request = debugger.launch(to_value(args).unwrap());
4268+ let _ = block_on(request).unwrap();
4262 // TODO: either await "initialized" or buffer commands until event is received
4270 // TODO: either await "initialized" or buffer commands until event is received
4264 cx.editor.debugger = Some(debugger);
4272 cx.editor.debugger = Some(debugger);
@@ -4303,20 +4311,6 @@ fn dap_toggle_breakpoint(cx: &mut Context) {
4306−fn dap_launch(cx: &mut Context) {
4307− use helix_lsp::block_on;
4308− use serde_json::to_value;
4310− if let Some(debugger) = &mut cx.editor.debugger {
4311− let mut args = HashMap::new();
4312− args.insert("mode", "debug");
4313− args.insert("program", "main.go");
4315− let request = debugger.launch(to_value(args).unwrap());
4316− let _ = block_on(request).unwrap();
4320fn dap_run(cx: &mut Context) {
4314fn dap_run(cx: &mut Context) {
4321 use helix_lsp::block_on;
4315 use helix_lsp::block_on;