rust/editors/code
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
..
src Merge #4448 2020-05-15 14:29:01 +00:00
.eslintrc.js vscode: remove type assertion 2020-02-24 21:23:56 +02:00
.gitignore add rollup bundler for vscode extension 2019-09-23 23:25:16 +02:00
.vscodeignore Import built-in textmate grammar, with no changes 2020-05-10 13:07:28 -07:00
icon.png Extension icon 2020-01-15 16:07:39 +01:00
package-lock.json Bump packages 2020-05-13 08:36:23 -04:00
package.json Merge #4448 2020-05-15 14:29:01 +00:00
ra_syntax_tree.tmGrammar.json Fix .rast tmGrammar to account for numbers in identifiers 2020-04-22 02:00:58 +03:00
README.md Minimal viable meta 2020-03-02 14:27:26 +01:00
rollup.config.js Add typing annotations for rollup config 2020-03-18 16:30:34 -06:00
rust.tmGrammar.json Use .rust suffix on scopes 2020-05-12 08:31:43 -07:00
tsconfig.json Target es2019 (code 1.43 uses chromium 78) 2020-03-18 16:30:34 -06:00

rust-analyzer

Provides support for rust-analyzer: novel LSP server for the Rust programming language.

See https://rust-analyzer.github.io/ for more information.