about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-12 13:45:25 +0000
committerbors <bors@rust-lang.org>2022-09-12 13:45:25 +0000
commitb54d22d96a0ee459536702172f2b5557de7d74f8 (patch)
tree457efd7de86c5e95cace27ad665fe596f2f0576e
parent7a704f2cc728d65ca29b18b3e617b35c2964fcdc (diff)
parent9c97997af939184d825b54cd25a0d0817a4fc8ac (diff)
downloadrust-b54d22d96a0ee459536702172f2b5557de7d74f8.tar.gz
rust-b54d22d96a0ee459536702172f2b5557de7d74f8.zip
Auto merge of #13215 - Veykril:toggle-inlay, r=Veykril
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.
-rw-r--r--editors/code/package.json9
-rw-r--r--editors/code/src/commands.ts24
-rw-r--r--editors/code/src/main.ts1
3 files changed, 0 insertions, 34 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index 2ffed7595af..cfba00d3ed0 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -207,11 +207,6 @@
                 "category": "rust-analyzer"
             },
             {
-                "command": "rust-analyzer.toggleInlayHints",
-                "title": "Toggle inlay hints",
-                "category": "rust-analyzer"
-            },
-            {
                 "command": "rust-analyzer.openDocs",
                 "title": "Open docs under cursor",
                 "category": "rust-analyzer"
@@ -1644,10 +1639,6 @@
                     "when": "inRustProject"
                 },
                 {
-                    "command": "rust-analyzer.toggleInlayHints",
-                    "when": "inRustProject"
-                },
-                {
                     "command": "rust-analyzer.openDocs",
                     "when": "inRustProject"
                 },
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index a21b304bbda..b9ad525e361 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -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`
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index e9b62e0cc25..41bde4195e0 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -180,7 +180,6 @@ async function initCommonContext(context: vscode.ExtensionContext, ctx: Ctx) {
 
     ctx.registerCommand("ssr", commands.ssr);
     ctx.registerCommand("serverVersion", commands.serverVersion);
-    ctx.registerCommand("toggleInlayHints", commands.toggleInlayHints);
 
     // Internal commands which are invoked by the server.
     ctx.registerCommand("runSingle", commands.runSingle);