Skip to content

Commit 9c97997

Browse files
committed
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.
1 parent 6909556 commit 9c97997

File tree

3 files changed

+0
-34
lines changed

3 files changed

+0
-34
lines changed

editors/code/package.json

-9
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@
206206
"title": "Show RA Version",
207207
"category": "rust-analyzer"
208208
},
209-
{
210-
"command": "rust-analyzer.toggleInlayHints",
211-
"title": "Toggle inlay hints",
212-
"category": "rust-analyzer"
213-
},
214209
{
215210
"command": "rust-analyzer.openDocs",
216211
"title": "Open docs under cursor",
@@ -1633,10 +1628,6 @@
16331628
"command": "rust-analyzer.serverVersion",
16341629
"when": "inRustProject"
16351630
},
1636-
{
1637-
"command": "rust-analyzer.toggleInlayHints",
1638-
"when": "inRustProject"
1639-
},
16401631
{
16411632
"command": "rust-analyzer.openDocs",
16421633
"when": "inRustProject"

editors/code/src/commands.ts

-24
Original file line numberDiff line numberDiff line change
@@ -321,30 +321,6 @@ export function serverVersion(ctx: Ctx): Cmd {
321321
};
322322
}
323323

324-
export function toggleInlayHints(_ctx: Ctx): Cmd {
325-
return async () => {
326-
const config = vscode.workspace.getConfiguration("editor.inlayHints", {
327-
languageId: "rust",
328-
});
329-
330-
const value = config.get("enabled");
331-
let stringValue;
332-
if (typeof value === "string") {
333-
stringValue = value;
334-
} else {
335-
stringValue = value ? "on" : "off";
336-
}
337-
const nextValues: Record<string, string> = {
338-
on: "off",
339-
off: "on",
340-
onUnlessPressed: "offUnlessPressed",
341-
offUnlessPressed: "onUnlessPressed",
342-
};
343-
const nextValue = nextValues[stringValue] ?? "on";
344-
await config.update("enabled", nextValue, vscode.ConfigurationTarget.Global);
345-
};
346-
}
347-
348324
// Opens the virtual file that will show the syntax tree
349325
//
350326
// The contents of the file come from the `TextDocumentContentProvider`

editors/code/src/main.ts

-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ async function initCommonContext(context: vscode.ExtensionContext, ctx: Ctx) {
180180

181181
ctx.registerCommand("ssr", commands.ssr);
182182
ctx.registerCommand("serverVersion", commands.serverVersion);
183-
ctx.registerCommand("toggleInlayHints", commands.toggleInlayHints);
184183

185184
// Internal commands which are invoked by the server.
186185
ctx.registerCommand("runSingle", commands.runSingle);

0 commit comments

Comments
 (0)