rust-tools.nvim icon indicating copy to clipboard operation
rust-tools.nvim copied to clipboard

Allow passing arguments to a debugger

Open lostl1ght opened this issue 2 years ago • 1 comments

Closes #241

Two notes:

  1. I have to split an input string by whitespace. Passing it as a whole in a table just doesn't work because a debuggee doesn't receive these arguments. E.g.:
args = { input }
  1. vim.ui.input() is evidently async. No idea how to make caller wait for the closure to return. That's why:
if --[[cond]] then
  -- code
    dap.run(dap_config)
  end)
else
  dap.run(dap_config)
end

Otherwise it works just fine.

lostl1ght avatar Aug 19 '22 19:08 lostl1ght

how will this work in config?

Zedai00 avatar Oct 07 '22 17:10 Zedai00

Neovim now supports .editorconfig files in 0.9, I think that would be a cleaner approach to setting debug values as opposed to just asking for input every time

simrat39 avatar Jan 25 '23 22:01 simrat39

Neovim now supports .editorconfig files in 0.9, I think that would be a cleaner approach to setting debug values as opposed to just asking for input every time

Can you give an example? @simrat39

imroc avatar Sep 01 '23 08:09 imroc

Any updates on this?

JxBP avatar Oct 11 '23 17:10 JxBP

Sorry for closing silently. I don't use neither rust-tools nor nvim-dap. I would suggest following simrat39's advice and using editorconfig to setup a DAP configuration. It is quite straightforward. Please read :h editorconfig, there is an example at the end.

lostl1ght avatar Oct 11 '23 21:10 lostl1ght

It is quite straightforward. Please read :h editorconfig, there is an example at the end.

The help page doesn't mention anything about DAP integration. It explains how to use editorconfig (and custom properties for it) in Lua but rust-tools.nvim would still need to actually read this file.

I could try and make a PR for that but what should the custom property be called?

JxBP avatar Oct 12 '23 15:10 JxBP