Open JP-Ellis opened 2 years ago
Yeah, this is something I very much want to have, but there's a large design space here. The upstream issue is tracked at https://github.com/microsoft/language-server-protocol/issues/944 but, historically, waiting for the upstream (lsp/vscode) wasn't productive.
So perhaps it makes sense to just do it ourselves. I think this mostly requires coding the VS Code side of things. I think the missing pieces are:
#[test]
function in the source code to the corresponding bit of JSON in the config. 2. Adding a 'Customize' option which would create a pre-filled entry in
launch.json
allowing for the task to be run this way (and customized). Perhaps this could apply more generally?
For Debug
you can use "rust-analyzer.newDebugConfig" command ("Generate launch configuration" in UI). It works exactly like described: creates a new configuration in launch.json
allowing to specify args, environment, etc.
Unfortunately it does not work for Run
Having the ability to quickly run and/or debug an individual test has been absolutely fantastic and in the case of tests and benchmarks, this is very straightforward. It would be nice though if the run/debug could be customized in some way within
examples/
(and I'm guessingbin/
too?) where the main function could reasonably expect command line arguments.I'm not sure what might be the best way to approach this. I can see a two main options:
launch.json
allowing for the task to be run this way (and customized). Perhaps this could apply more generally?