You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
{"rust-analyzer.debug.runtime": "vimspector"}
With this setup, :CocCommand rust-analyzer.debug calls Vimspector with a dictionary containing the three keys configuration, Executable, and Args. By default configuration is set to launch (configurable with rust-analyzer.debug.vimspector.configuration.name). Executable is the file path of the Rust binary and Args the arguments passed to it.
The Vimspector plugin obviously needs to be installed. In addition, run :VimspectorInstall CodeLLDB.
The key launch must be the same as rust-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.
The text was updated successfully, but these errors were encountered:
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
.The text was updated successfully, but these errors were encountered: