Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend dap.configurations.rust with discovered configurations, then use that in RustLsp debuggables #66

Closed
mrcjkb opened this issue Nov 18, 2023 · 1 comment · Fixed by #93

Comments

@mrcjkb
Copy link
Owner

mrcjkb commented Nov 18, 2023

          I'm not entirely sure (this was taken over from rust-tools.nvim).

I believe it may be to avoid overriding existing dap rust or lldb configurations.

Perhaps a better approach to this would be to load dap.configurations.rust and to extend it with the discovered configurations, and then to query nvim-dap for configurations to run.
That is how I do it in haskell-tools.nvim.

But maybe this is for another PR. I'll create an issue for it 😄

Originally posted by @mrcjkb in #64 (comment)

@bas-ie
Copy link
Contributor

bas-ie commented Nov 19, 2023

Yeah, this is something I was thinking about in reverse: how to let :lua require'dap'.toggle_breakpoint() work sensibly in case someone doesn't want to go through the debuggables selection screen. Prior to using these plugins, my approach was just to hit F5 and have the debugger start.

One possibility would be to check for the presence of dap.configurations.rust:

  • if present, extend it into dap.configurations.rnm-lldb (or whatever) to avoid overwriting it
  • if absent, attempt to sensibly define dap.configurations.rust
  • optionally, also define dap.configurations.rnm-lldb

The goal being the user doesn't have to care which configuration is used. Another option: allow an override e.g.

  use_configuration = 'dap.configurations.rust'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants