Open danielrainer opened 2 years ago
Wow! Thanks a lot both of you!
I made a video on this some time ago: https://www.youtube.com/watch?v=U3uvbdgFMRE
Though it would be nice if documentation was provided in the readme. I've also been waiting for dap support in coc.
I would suggest you try Vimspector.
Thank you guys, to be honest I didn't use debugging in vim/nvim. You're welcome to submit a PR for setting up debugging.
Honestly, that's interesting! I'd like to know if you could tell us what your debugging setup looks like.
Hi, thank you for this project!
I recently tried to get debugging to work with Vimspector. It works well now that I found out how to do it, but finding out how to set it up was quite difficult. I only managed to do it after looking into the code of this project to see how Vimspector is called when calling
:CocCommand rust-analyzer.debug
. It would be really nice if this project had some documentation and examples how to set up a debugger.For reference, and because I have no better place to put it, here is how I got it to work:
relevant settings in
coc-settings.json
(:CocConfig
):With this setup,
:CocCommand rust-analyzer.debug
calls Vimspector with a dictionary containing the three keysconfiguration
,Executable
, andArgs
. By defaultconfiguration
is set tolaunch
(configurable withrust-analyzer.debug.vimspector.configuration.name
).Executable
is the file path of the Rust binary andArgs
the arguments passed to it.The Vimspector plugin obviously needs to be installed. In addition, run
:VimspectorInstall CodeLLDB
.Vimspector needs to be configured with a config file. It can either be in the Rust project root and called
.vimspector.json
or a global config file (see https://puremourning.github.io/vimspector/configuration.html#project-and-global-configurations). The config file should look like this:The key
launch
must be the same asrust-analyzer.debug.vimspector.configuration.name
. The values"${Executable}"
and[ "*${Args}" ]
are automatically replaced by the values passed in by coc-rust-analyzer.At this point, it should be possible to run Rust executables and tests with
:CocCommand rust-analyzer.debug
.