Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove old inlay hints settings #12006

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/user/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ Just add this to your `settings.json`:
{
"editor.inlayHints.fontFamily": "Courier New",
"editor.inlayHints.fontSize": 11,
"workbench.colorCustomizations": {
// Name of the theme you are currently using
"[Default Dark+]": {
Expand Down Expand Up @@ -797,8 +797,8 @@ For example:
[source,json]
----
{
"key": "ctrl+i",
"command": "rust-analyzer.toggleInlayHints",
"key": "ctrl+alt+d",
"command": "rust-analyzer.openDocs",
"when": "inRustProject"
}
----
Expand Down
10 changes: 5 additions & 5 deletions editors/code/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ export function serverVersion(ctx: Ctx): Cmd {
};
}

export function toggleInlayHints(ctx: Ctx): Cmd {
export function toggleInlayHints(_ctx: Ctx): Cmd {
return async () => {
await vscode
.workspace
.getConfiguration(`${ctx.config.rootSection}.inlayHints`)
.update('enable', !ctx.config.inlayHints.enable, vscode.ConfigurationTarget.Global);
const scope = vscode.ConfigurationTarget.Global;
const config = vscode.workspace.getConfiguration("editor.inlayHints");
const value = !config.get("enabled");
await config.update('enabled', value, scope);
};
}

Expand Down
13 changes: 0 additions & 13 deletions editors/code/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@ export class Config {
get serverExtraEnv() { return this.get<Env | null>("server.extraEnv") ?? {}; }
get traceExtension() { return this.get<boolean>("trace.extension"); }

get inlayHints() {
return {
enable: this.get<boolean>("inlayHints.enable"),
typeHints: this.get<boolean>("inlayHints.typeHints"),
parameterHints: this.get<boolean>("inlayHints.parameterHints"),
chainingHints: this.get<boolean>("inlayHints.chainingHints"),
closureReturnTypeHints: this.get<boolean>("inlayHints.closureReturnTypeHints"),
hideNamedConstructorHints: this.get<boolean>("inlayHints.hideNamedConstructorHints"),
smallerHints: this.get<boolean>("inlayHints.smallerHints"),
maxLength: this.get<null | number>("inlayHints.maxLength"),
};
}

get cargoRunner() {
return this.get<string | undefined>("cargoRunner");
}
Expand Down