rust/editors/code/src
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
..
commands Merge #4448 2020-05-15 14:29:01 +00:00
cargo.ts Fix occasional test run during debug configuration 2020-05-15 15:31:09 +03:00
client.ts Merge #4145 2020-04-25 19:30:04 +00:00
config.ts Remove "rust-analyzer.debug.useLaunchJson" option 2020-05-14 11:12:10 +03:00
ctx.ts Remove unnecessary async from vscode language client creation 2020-04-25 20:52:50 +03:00
debug.ts Fix runnable naming in the client side fallback. 2020-05-14 17:33:49 +03:00
inlay_hints.ts Add master config for inlayHints to make disabling easy 2020-05-08 09:28:15 +02:00
main.ts "rust-analyzer.newDebugConfig" command 2020-05-11 18:04:49 +03:00
net.ts
persistent_state.ts
rust-analyzer-api.ts
source_change.ts Jump to sourceChanges in other files 2020-04-21 23:04:44 +02:00
status_display.ts Lean onto default implementation of configs 2020-04-02 12:47:58 +02:00
tasks.ts tasks.json Support 2020-04-22 17:05:04 -07:00
util.ts Fix cargo not found on macos bug at vscode extension side 2020-05-05 16:12:56 -07:00