diff options
| author | bors <bors@rust-lang.org> | 2022-05-13 19:36:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-13 19:36:32 +0000 |
| commit | 06448c5548d5d15c1dbbb5d89ba951504762a05e (patch) | |
| tree | bf99e85ec1fb10c632c3e01972517f5ebba20365 | |
| parent | a123f8dd661977bbde1f9eff90594961cc17f23d (diff) | |
| parent | 8496633c875c22e93c71c48c4103b54a464c388f (diff) | |
| download | rust-06448c5548d5d15c1dbbb5d89ba951504762a05e.tar.gz rust-06448c5548d5d15c1dbbb5d89ba951504762a05e.zip | |
Auto merge of #12246 - Veykril:config, r=Veykril
fix: Fix incorrect hover actions config keys
| -rw-r--r-- | crates/rust-analyzer/src/config.rs | 10 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/config/patch_old_style.rs | 12 | ||||
| -rw-r--r-- | docs/user/generated_config.adoc | 10 | ||||
| -rw-r--r-- | editors/code/package.json | 10 | ||||
| -rw-r--r-- | editors/code/src/client.ts | 4 | ||||
| -rw-r--r-- | editors/code/src/config.ts | 24 |
6 files changed, 36 insertions, 34 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index c7158648d86..150cc21a17b 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -221,21 +221,21 @@ config_data! { highlightRelated_yieldPoints_enable: bool = "true", /// Whether to show `Debug` action. Only applies when - /// `#rust-analyzer.hoverActions.enable#` is set. + /// `#rust-analyzer.hover.actions.enable#` is set. hover_actions_debug_enable: bool = "true", /// Whether to show HoverActions in Rust files. hover_actions_enable: bool = "true", /// Whether to show `Go to Type Definition` action. Only applies when - /// `#rust-analyzer.hoverActions.enable#` is set. + /// `#rust-analyzer.hover.actions.enable#` is set. hover_actions_gotoTypeDef_enable: bool = "true", /// Whether to show `Implementations` action. Only applies when - /// `#rust-analyzer.hoverActions.enable#` is set. + /// `#rust-analyzer.hover.actions.enable#` is set. hover_actions_implementations_enable: bool = "true", /// Whether to show `References` action. Only applies when - /// `#rust-analyzer.hoverActions.enable#` is set. + /// `#rust-analyzer.hover.actions.enable#` is set. hover_actions_references_enable: bool = "false", /// Whether to show `Run` action. Only applies when - /// `#rust-analyzer.hoverActions.enable#` is set. + /// `#rust-analyzer.hover.actions.enable#` is set. hover_actions_run_enable: bool = "true", /// Whether to show documentation on hover. diff --git a/crates/rust-analyzer/src/config/patch_old_style.rs b/crates/rust-analyzer/src/config/patch_old_style.rs index 05c2bb537f8..e21298e22cb 100644 --- a/crates/rust-analyzer/src/config/patch_old_style.rs +++ b/crates/rust-analyzer/src/config/patch_old_style.rs @@ -50,12 +50,12 @@ pub(super) fn patch_json_for_outdated_configs(json: &mut Value) { hover.documentation -> hover.documentation.enable; hover.linksInHover -> hover.links.enable; hoverActions.linksInHover -> hover.links.enable; - hoverActions.debug -> hoverActions.debug.enable; - hoverActions.enable -> hoverActions.enable; - hoverActions.gotoTypeDef -> hoverActions.gotoTypeDef.enable; - hoverActions.implementations -> hoverActions.implementations.enable; - hoverActions.references -> hoverActions.references.enable; - hoverActions.run -> hoverActions.run.enable; + hoverActions.debug -> hover.actions.debug.enable; + hoverActions.enable -> hover.actions.enable; + hoverActions.gotoTypeDef -> hover.actions.gotoTypeDef.enable; + hoverActions.implementations -> hover.actions.implementations.enable; + hoverActions.references -> hover.actions.references.enable; + hoverActions.run -> hover.actions.run.enable; inlayHints.chainingHints -> inlayHints.chainingHints.enable; inlayHints.closureReturnTypeHints -> inlayHints.closureReturnTypeHints.enable; inlayHints.hideNamedConstructorHints -> inlayHints.typeHints.hideNamedConstructorHints; diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index c6fa55c05b3..35e0a4082eb 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -278,7 +278,7 @@ Enables highlighting of all break points for a loop or block context while the c + -- Whether to show `Debug` action. Only applies when -`#rust-analyzer.hoverActions.enable#` is set. +`#rust-analyzer.hover.actions.enable#` is set. -- [[rust-analyzer.hover.actions.enable]]rust-analyzer.hover.actions.enable (default: `true`):: + @@ -289,25 +289,25 @@ Whether to show HoverActions in Rust files. + -- Whether to show `Go to Type Definition` action. Only applies when -`#rust-analyzer.hoverActions.enable#` is set. +`#rust-analyzer.hover.actions.enable#` is set. -- [[rust-analyzer.hover.actions.implementations.enable]]rust-analyzer.hover.actions.implementations.enable (default: `true`):: + -- Whether to show `Implementations` action. Only applies when -`#rust-analyzer.hoverActions.enable#` is set. +`#rust-analyzer.hover.actions.enable#` is set. -- [[rust-analyzer.hover.actions.references.enable]]rust-analyzer.hover.actions.references.enable (default: `false`):: + -- Whether to show `References` action. Only applies when -`#rust-analyzer.hoverActions.enable#` is set. +`#rust-analyzer.hover.actions.enable#` is set. -- [[rust-analyzer.hover.actions.run.enable]]rust-analyzer.hover.actions.run.enable (default: `true`):: + -- Whether to show `Run` action. Only applies when -`#rust-analyzer.hoverActions.enable#` is set. +`#rust-analyzer.hover.actions.enable#` is set. -- [[rust-analyzer.hover.documentation.enable]]rust-analyzer.hover.documentation.enable (default: `true`):: + diff --git a/editors/code/package.json b/editors/code/package.json index d21d1139d30..62b0f3c0baf 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -698,7 +698,7 @@ "type": "boolean" }, "rust-analyzer.hover.actions.debug.enable": { - "markdownDescription": "Whether to show `Debug` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.", + "markdownDescription": "Whether to show `Debug` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.", "default": true, "type": "boolean" }, @@ -708,22 +708,22 @@ "type": "boolean" }, "rust-analyzer.hover.actions.gotoTypeDef.enable": { - "markdownDescription": "Whether to show `Go to Type Definition` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.", + "markdownDescription": "Whether to show `Go to Type Definition` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.", "default": true, "type": "boolean" }, "rust-analyzer.hover.actions.implementations.enable": { - "markdownDescription": "Whether to show `Implementations` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.", + "markdownDescription": "Whether to show `Implementations` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.", "default": true, "type": "boolean" }, "rust-analyzer.hover.actions.references.enable": { - "markdownDescription": "Whether to show `References` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.", + "markdownDescription": "Whether to show `References` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.", "default": false, "type": "boolean" }, "rust-analyzer.hover.actions.run.enable": { - "markdownDescription": "Whether to show `Run` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.", + "markdownDescription": "Whether to show `Run` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.", "default": true, "type": "boolean" }, diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index d28c20aa08f..7519cd3de37 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -49,7 +49,9 @@ export async function createClient(serverPath: string, workspace: Workspace, ext let initializationOptions = vscode.workspace.getConfiguration("rust-analyzer"); // Update outdated user configs - await updateConfig(initializationOptions); + await updateConfig(initializationOptions).catch(err => { + void vscode.window.showErrorMessage(`Failed updating old config keys: ${err.message}`); + }); if (workspace.kind === "Detached Files") { initializationOptions = { "detachedFiles": workspace.files.map(file => file.uri.fsPath), ...initializationOptions }; diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index d34e82a1a6e..952a88acff7 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -123,12 +123,12 @@ export class Config { get hoverActions() { return { - enable: this.get<boolean>("hoverActions.enable"), - implementations: this.get<boolean>("hoverActions.implementations.enable"), - references: this.get<boolean>("hoverActions.references.enable"), - run: this.get<boolean>("hoverActions.run.enable"), - debug: this.get<boolean>("hoverActions.debug.enable"), - gotoTypeDef: this.get<boolean>("hoverActions.gotoTypeDef.enable"), + enable: this.get<boolean>("hover.actions.enable"), + implementations: this.get<boolean>("hover.actions.implementations.enable"), + references: this.get<boolean>("hover.actions.references.enable"), + run: this.get<boolean>("hover.actions.run.enable"), + debug: this.get<boolean>("hover.actions.debug.enable"), + gotoTypeDef: this.get<boolean>("hover.actions.gotoTypeDef.enable"), }; } @@ -164,12 +164,12 @@ export async function updateConfig(config: vscode.WorkspaceConfiguration) { ["hover.documentation", "hover.documentation.enable",], ["hover.linksInHover", "hover.links.enable",], ["hoverActions.linksInHover", "hover.links.enable",], - ["hoverActions.debug", "hoverActions.debug.enable",], - ["hoverActions.enable", "hoverActions.enable.enable",], - ["hoverActions.gotoTypeDef", "hoverActions.gotoTypeDef.enable",], - ["hoverActions.implementations", "hoverActions.implementations.enable",], - ["hoverActions.references", "hoverActions.references.enable",], - ["hoverActions.run", "hoverActions.run.enable",], + ["hoverActions.debug", "hover.actions.debug.enable",], + ["hoverActions.enable", "hover.actions.enable.enable",], + ["hoverActions.gotoTypeDef", "hover.actions.gotoTypeDef.enable",], + ["hoverActions.implementations", "hover.actions.implementations.enable",], + ["hoverActions.references", "hover.actions.references.enable",], + ["hoverActions.run", "hover.actions.run.enable",], ["inlayHints.chainingHints", "inlayHints.chainingHints.enable",], ["inlayHints.closureReturnTypeHints", "inlayHints.closureReturnTypeHints.enable",], ["inlayHints.hideNamedConstructorHints", "inlayHints.typeHints.hideNamedConstructorHints",], |
