mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 03:44:23 +00:00
Remove the toggleInlayHints command from VSCode
Inlay hints are no longer something specifc to r-a as it has been upstreamed into the LSP, we don't have a reason to give the config for this feature special treatment in regards to toggling. There are plenty of other options out there in the VSCode marketplace to create toggle commands/hotkeys for configurations in general which I believe we should nudge people towards instead.
This commit is contained in:
parent
6909556435
commit
9c97997af9
3 changed files with 0 additions and 34 deletions
|
@ -321,30 +321,6 @@ export function serverVersion(ctx: Ctx): Cmd {
|
|||
};
|
||||
}
|
||||
|
||||
export function toggleInlayHints(_ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const config = vscode.workspace.getConfiguration("editor.inlayHints", {
|
||||
languageId: "rust",
|
||||
});
|
||||
|
||||
const value = config.get("enabled");
|
||||
let stringValue;
|
||||
if (typeof value === "string") {
|
||||
stringValue = value;
|
||||
} else {
|
||||
stringValue = value ? "on" : "off";
|
||||
}
|
||||
const nextValues: Record<string, string> = {
|
||||
on: "off",
|
||||
off: "on",
|
||||
onUnlessPressed: "offUnlessPressed",
|
||||
offUnlessPressed: "onUnlessPressed",
|
||||
};
|
||||
const nextValue = nextValues[stringValue] ?? "on";
|
||||
await config.update("enabled", nextValue, vscode.ConfigurationTarget.Global);
|
||||
};
|
||||
}
|
||||
|
||||
// Opens the virtual file that will show the syntax tree
|
||||
//
|
||||
// The contents of the file come from the `TextDocumentContentProvider`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue