rust/crates
bors[bot] d51c1f6217
Merge #4448
4448: Generate configuration for launch.json r=vsrs a=vsrs

This PR adds two new commands: `"rust-analyzer.debug"` and `"rust-analyzer.newDebugConfig"`. The former is a supplement to the existing `"rust-analyzer.run"` command and works the same way: asks for a runnable and starts new debug session. The latter allows adding a new configuration to **launch.json** (or to update an existing one).

If the new option `"rust-analyzer.debug.useLaunchJson"` is set to true then `"rust-analyzer.debug"` and Debug Lens will first look for existing debug configuration in **launch.json**. That is, it has become possible to specify startup arguments, env variables, etc.

`"rust-analyzer.debug.useLaunchJson"` is false by default, but it might be worth making true the default value. Personally I prefer true, but I'm not sure if it is good for all value.

----
I think that this PR also solves https://github.com/rust-analyzer/rust-analyzer/issues/3441.
Both methods to update launch.json mentioned in the issue do not work:
1. Menu. It is only possible to add a launch.json configuration template via a debug adapter. And anyway it's only a template and it is impossible to specify arguments from an extension.

2. DebugConfigurationProvider. The exact opposite situation: it is possible to specify all debug session settings, but it is impossible to export these settings to launch.json.

Separate `"rust-analyzer.newDebugConfig"` command looks better for me.

----
Fixes #4450
Fixes #3441

Co-authored-by: vsrs <vit@conrlab.com>
Co-authored-by: vsrs <62505555+vsrs@users.noreply.github.com>
2020-05-15 14:29:01 +00:00
..
ra_arena Extract messy tree handling out of profiling code 2020-04-25 21:22:40 +02:00
ra_assists Merge #4273 2020-05-14 14:29:22 +00:00
ra_cfg Move feature desugaring to the right abstraction layer 2020-05-08 02:56:53 +02:00
ra_db Expand fixture documentation a little 2020-05-10 16:51:12 +02:00
ra_flycheck Cleanups 2020-05-15 02:09:30 +02:00
ra_fmt Introduce EffectExpr 2020-05-02 11:21:39 +02:00
ra_hir Ty -> Type 2020-05-14 13:53:45 +03:00
ra_hir_def Highlight mutable statics as mutable 2020-05-10 16:25:51 +01:00
ra_hir_expand Store proc-macro result in salsa db 2020-05-14 17:57:51 +08:00
ra_hir_ty Adds a param_idx helper 2020-05-14 13:47:36 +03:00
ra_ide Prioritize locals with correct types 2020-05-14 15:15:52 +02:00
ra_ide_db New definition_visibility method 2020-05-11 14:28:14 +03:00
ra_mbe Store proc-macro result in salsa db 2020-05-14 17:57:51 +08:00
ra_parser Fix parsing of blocks without { 2020-05-02 14:35:17 +02:00
ra_proc_macro proc_macro: add ability to log to stderr and view output in vscode 2020-04-23 01:57:02 +03:00
ra_proc_macro_srv Remove dbg 2020-05-10 06:39:36 +08:00
ra_prof Simplify profiler impl (bubble up Option and shorten code 2020-04-26 00:55:49 +03:00
ra_project_model Make some stuff public so that they can be reused by other tools 2020-05-14 11:14:46 +02:00
ra_syntax Merge #4445 2020-05-14 11:20:42 +00:00
ra_text_edit Make some stuff public so that they can be reused by other tools 2020-05-14 11:14:46 +02:00
ra_toolchain Simplify match 2020-05-09 22:20:11 +03:00
ra_tt Store proc-macro result in salsa db 2020-05-14 17:57:51 +08:00
rust-analyzer Merge #4448 2020-05-15 14:29:01 +00:00
stdx Move snake case method to heck 2020-05-03 21:35:21 +03:00
test_utils unindent -> dedent 2020-05-09 14:48:43 +02:00