Show current rust-analyzer version.
+#### Toggle inlay hints
+
+Toggle inlay hints view for the current workspace.
+It is recommended to assign a shortcut for this command to quickly turn off
+inlay hints when they prevent you from reading/writing the code.
+
#### Run Garbage Collection
Manually triggers GC.
"command": "rust-analyzer.serverVersion",
"title": "Show RA Version",
"category": "Rust Analyzer"
+ },
+ {
+ "command": "rust-analyzer.toggleInlayHints",
+ "title": "Toggle inlay hints",
+ "category": "Rust Analyzer"
}
],
"keybindings": [
export * from './runnables';
export * from './ssr';
export * from './server_version';
+export * from './toggle_inlay_hints';
export function collectGarbage(ctx: Ctx): Cmd {
return async () => ctx.client.sendRequest(ra.collectGarbage, null);
--- /dev/null
+import * as vscode from 'vscode';
+import { Ctx, Cmd } from '../ctx';
+
+export function toggleInlayHints(ctx: Ctx): Cmd {
+ return async () => {
+ await vscode
+ .workspace
+ .getConfiguration(`${ctx.config.rootSection}.inlayHints`)
+ .update('enable', !ctx.config.inlayHints.enable, vscode.ConfigurationTarget.Workspace);
+ };
+}
export class Config {
readonly extensionId = "matklad.rust-analyzer";
- private readonly rootSection = "rust-analyzer";
+ readonly rootSection = "rust-analyzer";
private readonly requiresReloadOpts = [
"serverPath",
"cargo",
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);