Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 06448c5

Browse files
committed
Auto merge of rust-lang#12246 - Veykril:config, r=Veykril
fix: Fix incorrect hover actions config keys
2 parents a123f8d + 8496633 commit 06448c5

File tree

6 files changed

+36
-34
lines changed

6 files changed

+36
-34
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,21 @@ config_data! {
221221
highlightRelated_yieldPoints_enable: bool = "true",
222222

223223
/// Whether to show `Debug` action. Only applies when
224-
/// `#rust-analyzer.hoverActions.enable#` is set.
224+
/// `#rust-analyzer.hover.actions.enable#` is set.
225225
hover_actions_debug_enable: bool = "true",
226226
/// Whether to show HoverActions in Rust files.
227227
hover_actions_enable: bool = "true",
228228
/// Whether to show `Go to Type Definition` action. Only applies when
229-
/// `#rust-analyzer.hoverActions.enable#` is set.
229+
/// `#rust-analyzer.hover.actions.enable#` is set.
230230
hover_actions_gotoTypeDef_enable: bool = "true",
231231
/// Whether to show `Implementations` action. Only applies when
232-
/// `#rust-analyzer.hoverActions.enable#` is set.
232+
/// `#rust-analyzer.hover.actions.enable#` is set.
233233
hover_actions_implementations_enable: bool = "true",
234234
/// Whether to show `References` action. Only applies when
235-
/// `#rust-analyzer.hoverActions.enable#` is set.
235+
/// `#rust-analyzer.hover.actions.enable#` is set.
236236
hover_actions_references_enable: bool = "false",
237237
/// Whether to show `Run` action. Only applies when
238-
/// `#rust-analyzer.hoverActions.enable#` is set.
238+
/// `#rust-analyzer.hover.actions.enable#` is set.
239239
hover_actions_run_enable: bool = "true",
240240

241241
/// Whether to show documentation on hover.

crates/rust-analyzer/src/config/patch_old_style.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ pub(super) fn patch_json_for_outdated_configs(json: &mut Value) {
5050
hover.documentation -> hover.documentation.enable;
5151
hover.linksInHover -> hover.links.enable;
5252
hoverActions.linksInHover -> hover.links.enable;
53-
hoverActions.debug -> hoverActions.debug.enable;
54-
hoverActions.enable -> hoverActions.enable;
55-
hoverActions.gotoTypeDef -> hoverActions.gotoTypeDef.enable;
56-
hoverActions.implementations -> hoverActions.implementations.enable;
57-
hoverActions.references -> hoverActions.references.enable;
58-
hoverActions.run -> hoverActions.run.enable;
53+
hoverActions.debug -> hover.actions.debug.enable;
54+
hoverActions.enable -> hover.actions.enable;
55+
hoverActions.gotoTypeDef -> hover.actions.gotoTypeDef.enable;
56+
hoverActions.implementations -> hover.actions.implementations.enable;
57+
hoverActions.references -> hover.actions.references.enable;
58+
hoverActions.run -> hover.actions.run.enable;
5959
inlayHints.chainingHints -> inlayHints.chainingHints.enable;
6060
inlayHints.closureReturnTypeHints -> inlayHints.closureReturnTypeHints.enable;
6161
inlayHints.hideNamedConstructorHints -> inlayHints.typeHints.hideNamedConstructorHints;

docs/user/generated_config.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Enables highlighting of all break points for a loop or block context while the c
278278
+
279279
--
280280
Whether to show `Debug` action. Only applies when
281-
`#rust-analyzer.hoverActions.enable#` is set.
281+
`#rust-analyzer.hover.actions.enable#` is set.
282282
--
283283
[[rust-analyzer.hover.actions.enable]]rust-analyzer.hover.actions.enable (default: `true`)::
284284
+
@@ -289,25 +289,25 @@ Whether to show HoverActions in Rust files.
289289
+
290290
--
291291
Whether to show `Go to Type Definition` action. Only applies when
292-
`#rust-analyzer.hoverActions.enable#` is set.
292+
`#rust-analyzer.hover.actions.enable#` is set.
293293
--
294294
[[rust-analyzer.hover.actions.implementations.enable]]rust-analyzer.hover.actions.implementations.enable (default: `true`)::
295295
+
296296
--
297297
Whether to show `Implementations` action. Only applies when
298-
`#rust-analyzer.hoverActions.enable#` is set.
298+
`#rust-analyzer.hover.actions.enable#` is set.
299299
--
300300
[[rust-analyzer.hover.actions.references.enable]]rust-analyzer.hover.actions.references.enable (default: `false`)::
301301
+
302302
--
303303
Whether to show `References` action. Only applies when
304-
`#rust-analyzer.hoverActions.enable#` is set.
304+
`#rust-analyzer.hover.actions.enable#` is set.
305305
--
306306
[[rust-analyzer.hover.actions.run.enable]]rust-analyzer.hover.actions.run.enable (default: `true`)::
307307
+
308308
--
309309
Whether to show `Run` action. Only applies when
310-
`#rust-analyzer.hoverActions.enable#` is set.
310+
`#rust-analyzer.hover.actions.enable#` is set.
311311
--
312312
[[rust-analyzer.hover.documentation.enable]]rust-analyzer.hover.documentation.enable (default: `true`)::
313313
+

editors/code/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@
698698
"type": "boolean"
699699
},
700700
"rust-analyzer.hover.actions.debug.enable": {
701-
"markdownDescription": "Whether to show `Debug` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.",
701+
"markdownDescription": "Whether to show `Debug` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.",
702702
"default": true,
703703
"type": "boolean"
704704
},
@@ -708,22 +708,22 @@
708708
"type": "boolean"
709709
},
710710
"rust-analyzer.hover.actions.gotoTypeDef.enable": {
711-
"markdownDescription": "Whether to show `Go to Type Definition` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.",
711+
"markdownDescription": "Whether to show `Go to Type Definition` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.",
712712
"default": true,
713713
"type": "boolean"
714714
},
715715
"rust-analyzer.hover.actions.implementations.enable": {
716-
"markdownDescription": "Whether to show `Implementations` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.",
716+
"markdownDescription": "Whether to show `Implementations` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.",
717717
"default": true,
718718
"type": "boolean"
719719
},
720720
"rust-analyzer.hover.actions.references.enable": {
721-
"markdownDescription": "Whether to show `References` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.",
721+
"markdownDescription": "Whether to show `References` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.",
722722
"default": false,
723723
"type": "boolean"
724724
},
725725
"rust-analyzer.hover.actions.run.enable": {
726-
"markdownDescription": "Whether to show `Run` action. Only applies when\n`#rust-analyzer.hoverActions.enable#` is set.",
726+
"markdownDescription": "Whether to show `Run` action. Only applies when\n`#rust-analyzer.hover.actions.enable#` is set.",
727727
"default": true,
728728
"type": "boolean"
729729
},

editors/code/src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export async function createClient(serverPath: string, workspace: Workspace, ext
4949
let initializationOptions = vscode.workspace.getConfiguration("rust-analyzer");
5050

5151
// Update outdated user configs
52-
await updateConfig(initializationOptions);
52+
await updateConfig(initializationOptions).catch(err => {
53+
void vscode.window.showErrorMessage(`Failed updating old config keys: ${err.message}`);
54+
});
5355

5456
if (workspace.kind === "Detached Files") {
5557
initializationOptions = { "detachedFiles": workspace.files.map(file => file.uri.fsPath), ...initializationOptions };

editors/code/src/config.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ export class Config {
123123

124124
get hoverActions() {
125125
return {
126-
enable: this.get<boolean>("hoverActions.enable"),
127-
implementations: this.get<boolean>("hoverActions.implementations.enable"),
128-
references: this.get<boolean>("hoverActions.references.enable"),
129-
run: this.get<boolean>("hoverActions.run.enable"),
130-
debug: this.get<boolean>("hoverActions.debug.enable"),
131-
gotoTypeDef: this.get<boolean>("hoverActions.gotoTypeDef.enable"),
126+
enable: this.get<boolean>("hover.actions.enable"),
127+
implementations: this.get<boolean>("hover.actions.implementations.enable"),
128+
references: this.get<boolean>("hover.actions.references.enable"),
129+
run: this.get<boolean>("hover.actions.run.enable"),
130+
debug: this.get<boolean>("hover.actions.debug.enable"),
131+
gotoTypeDef: this.get<boolean>("hover.actions.gotoTypeDef.enable"),
132132
};
133133
}
134134

@@ -164,12 +164,12 @@ export async function updateConfig(config: vscode.WorkspaceConfiguration) {
164164
["hover.documentation", "hover.documentation.enable",],
165165
["hover.linksInHover", "hover.links.enable",],
166166
["hoverActions.linksInHover", "hover.links.enable",],
167-
["hoverActions.debug", "hoverActions.debug.enable",],
168-
["hoverActions.enable", "hoverActions.enable.enable",],
169-
["hoverActions.gotoTypeDef", "hoverActions.gotoTypeDef.enable",],
170-
["hoverActions.implementations", "hoverActions.implementations.enable",],
171-
["hoverActions.references", "hoverActions.references.enable",],
172-
["hoverActions.run", "hoverActions.run.enable",],
167+
["hoverActions.debug", "hover.actions.debug.enable",],
168+
["hoverActions.enable", "hover.actions.enable.enable",],
169+
["hoverActions.gotoTypeDef", "hover.actions.gotoTypeDef.enable",],
170+
["hoverActions.implementations", "hover.actions.implementations.enable",],
171+
["hoverActions.references", "hover.actions.references.enable",],
172+
["hoverActions.run", "hover.actions.run.enable",],
173173
["inlayHints.chainingHints", "inlayHints.chainingHints.enable",],
174174
["inlayHints.closureReturnTypeHints", "inlayHints.closureReturnTypeHints.enable",],
175175
["inlayHints.hideNamedConstructorHints", "inlayHints.typeHints.hideNamedConstructorHints",],

0 commit comments

Comments
 (0)