Skip to content

Commit 66c232d

Browse files
committed
Auto merge of rust-lang#12006 - lnicola:toggle-inlay-hints, r=lnicola
fix: Remove old inlay hints settings Closes rust-lang#11998
2 parents 1c22537 + f77adb3 commit 66c232d

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

docs/user/manual.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ Just add this to your `settings.json`:
722722
{
723723
"editor.inlayHints.fontFamily": "Courier New",
724724
"editor.inlayHints.fontSize": 11,
725-
725+
726726
"workbench.colorCustomizations": {
727727
// Name of the theme you are currently using
728728
"[Default Dark+]": {
@@ -797,8 +797,8 @@ For example:
797797
[source,json]
798798
----
799799
{
800-
"key": "ctrl+i",
801-
"command": "rust-analyzer.toggleInlayHints",
800+
"key": "ctrl+alt+d",
801+
"command": "rust-analyzer.openDocs",
802802
"when": "inRustProject"
803803
}
804804
----

editors/code/src/commands.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,12 @@ export function serverVersion(ctx: Ctx): Cmd {
298298
};
299299
}
300300

301-
export function toggleInlayHints(ctx: Ctx): Cmd {
301+
export function toggleInlayHints(_ctx: Ctx): Cmd {
302302
return async () => {
303-
await vscode
304-
.workspace
305-
.getConfiguration(`${ctx.config.rootSection}.inlayHints`)
306-
.update('enable', !ctx.config.inlayHints.enable, vscode.ConfigurationTarget.Global);
303+
const scope = vscode.ConfigurationTarget.Global;
304+
const config = vscode.workspace.getConfiguration("editor.inlayHints");
305+
const value = !config.get("enabled");
306+
await config.update('enabled', value, scope);
307307
};
308308
}
309309

editors/code/src/config.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,6 @@ export class Config {
9797
get serverExtraEnv() { return this.get<Env | null>("server.extraEnv") ?? {}; }
9898
get traceExtension() { return this.get<boolean>("trace.extension"); }
9999

100-
get inlayHints() {
101-
return {
102-
enable: this.get<boolean>("inlayHints.enable"),
103-
typeHints: this.get<boolean>("inlayHints.typeHints"),
104-
parameterHints: this.get<boolean>("inlayHints.parameterHints"),
105-
chainingHints: this.get<boolean>("inlayHints.chainingHints"),
106-
closureReturnTypeHints: this.get<boolean>("inlayHints.closureReturnTypeHints"),
107-
hideNamedConstructorHints: this.get<boolean>("inlayHints.hideNamedConstructorHints"),
108-
smallerHints: this.get<boolean>("inlayHints.smallerHints"),
109-
maxLength: this.get<null | number>("inlayHints.maxLength"),
110-
};
111-
}
112-
113100
get cargoRunner() {
114101
return this.get<string | undefined>("cargoRunner");
115102
}

0 commit comments

Comments
 (0)