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/src/main.ts | |
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/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 9b020d001..c015460b8 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -77,6 +77,8 @@ export async function activate(context: vscode.ExtensionContext) { | |||
77 | ctx.registerCommand('syntaxTree', commands.syntaxTree); | 77 | ctx.registerCommand('syntaxTree', commands.syntaxTree); |
78 | ctx.registerCommand('expandMacro', commands.expandMacro); | 78 | ctx.registerCommand('expandMacro', commands.expandMacro); |
79 | ctx.registerCommand('run', commands.run); | 79 | ctx.registerCommand('run', commands.run); |
80 | ctx.registerCommand('debug', commands.debug); | ||
81 | ctx.registerCommand('newDebugConfig', commands.newDebugConfig); | ||
80 | 82 | ||
81 | defaultOnEnter.dispose(); | 83 | defaultOnEnter.dispose(); |
82 | ctx.registerCommand('onEnter', commands.onEnter); | 84 | ctx.registerCommand('onEnter', commands.onEnter); |