diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-15 15:29:01 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-15 15:29:01 +0100 |
commit | d51c1f62178c383363a2d95e865131d9a7b969d0 (patch) | |
tree | 5235615134ab3798f21a167c71ce175795fc6798 /editors/code/package.json | |
parent | 982b92f966518a0e24632fafdc18d7b5ab6928b4 (diff) | |
parent | a4ecaa70969067c1149711dbf1f40a8a95cb5b72 (diff) |
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 <[email protected]>
Co-authored-by: vsrs <[email protected]>
Diffstat (limited to 'editors/code/package.json')
-rw-r--r-- | editors/code/package.json | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index b8a2182f0..4e7e3faf7 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -121,6 +121,16 @@ | |||
121 | "category": "Rust Analyzer" | 121 | "category": "Rust Analyzer" |
122 | }, | 122 | }, |
123 | { | 123 | { |
124 | "command": "rust-analyzer.debug", | ||
125 | "title": "Debug", | ||
126 | "category": "Rust Analyzer" | ||
127 | }, | ||
128 | { | ||
129 | "command": "rust-analyzer.newDebugConfig", | ||
130 | "title": "Generate launch configuration", | ||
131 | "category": "Rust Analyzer" | ||
132 | }, | ||
133 | { | ||
124 | "command": "rust-analyzer.analyzerStatus", | 134 | "command": "rust-analyzer.analyzerStatus", |
125 | "title": "Status", | 135 | "title": "Status", |
126 | "category": "Rust Analyzer" | 136 | "category": "Rust Analyzer" |