File tree Expand file tree Collapse file tree 6 files changed +25
-1
lines changed Expand file tree Collapse file tree 6 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ Shows internal statistic about memory usage of rust-analyzer.
9393
9494Show current rust-analyzer version.
9595
96+ #### Toggle inlay hints
97+
98+ Toggle inlay hints view for the current workspace.
99+ It is recommended to assign a shortcut for this command to quickly turn off
100+ inlay hints when they prevent you from reading/writing the code.
101+
96102#### Run Garbage Collection
97103
98104Manually triggers GC.
Original file line number Diff line number Diff line change 166166 "command" : " rust-analyzer.serverVersion" ,
167167 "title" : " Show RA Version" ,
168168 "category" : " Rust Analyzer"
169+ },
170+ {
171+ "command" : " rust-analyzer.toggleInlayHints" ,
172+ "title" : " Toggle inlay hints" ,
173+ "category" : " Rust Analyzer"
169174 }
170175 ],
171176 "keybindings" : [
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export * from './expand_macro';
1616export * from './runnables' ;
1717export * from './ssr' ;
1818export * from './server_version' ;
19+ export * from './toggle_inlay_hints' ;
1920
2021export function collectGarbage ( ctx : Ctx ) : Cmd {
2122 return async ( ) => ctx . client . sendRequest ( ra . collectGarbage , null ) ;
Original file line number Diff line number Diff line change 1+ import * as vscode from 'vscode' ;
2+ import { Ctx , Cmd } from '../ctx' ;
3+
4+ export function toggleInlayHints ( ctx : Ctx ) : Cmd {
5+ return async ( ) => {
6+ await vscode
7+ . workspace
8+ . getConfiguration ( `${ ctx . config . rootSection } .inlayHints` )
9+ . update ( 'enable' , ! ctx . config . inlayHints . enable , vscode . ConfigurationTarget . Workspace ) ;
10+ } ;
11+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export const NIGHTLY_TAG = "nightly";
88export class Config {
99 readonly extensionId = "matklad.rust-analyzer" ;
1010
11- private readonly rootSection = "rust-analyzer" ;
11+ readonly rootSection = "rust-analyzer" ;
1212 private readonly requiresReloadOpts = [
1313 "serverPath" ,
1414 "cargo" ,
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export async function activate(context: vscode.ExtensionContext) {
8686
8787 ctx . registerCommand ( 'ssr' , commands . ssr ) ;
8888 ctx . registerCommand ( 'serverVersion' , commands . serverVersion ) ;
89+ ctx . registerCommand ( 'toggleInlayHints' , commands . toggleInlayHints ) ;
8990
9091 // Internal commands which are invoked by the server.
9192 ctx . registerCommand ( 'runSingle' , commands . runSingle ) ;
You can’t perform that action at this time.
0 commit comments