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.
93
93
94
94
Show current rust-analyzer version.
95
95
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
+
96
102
#### Run Garbage Collection
97
103
98
104
Manually triggers GC.
Original file line number Diff line number Diff line change 166
166
"command" : " rust-analyzer.serverVersion" ,
167
167
"title" : " Show RA Version" ,
168
168
"category" : " Rust Analyzer"
169
+ },
170
+ {
171
+ "command" : " rust-analyzer.toggleInlayHints" ,
172
+ "title" : " Toggle inlay hints" ,
173
+ "category" : " Rust Analyzer"
169
174
}
170
175
],
171
176
"keybindings" : [
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export * from './expand_macro';
16
16
export * from './runnables' ;
17
17
export * from './ssr' ;
18
18
export * from './server_version' ;
19
+ export * from './toggle_inlay_hints' ;
19
20
20
21
export function collectGarbage ( ctx : Ctx ) : Cmd {
21
22
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";
8
8
export class Config {
9
9
readonly extensionId = "matklad.rust-analyzer" ;
10
10
11
- private readonly rootSection = "rust-analyzer" ;
11
+ readonly rootSection = "rust-analyzer" ;
12
12
private readonly requiresReloadOpts = [
13
13
"serverPath" ,
14
14
"cargo" ,
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export async function activate(context: vscode.ExtensionContext) {
86
86
87
87
ctx . registerCommand ( 'ssr' , commands . ssr ) ;
88
88
ctx . registerCommand ( 'serverVersion' , commands . serverVersion ) ;
89
+ ctx . registerCommand ( 'toggleInlayHints' , commands . toggleInlayHints ) ;
89
90
90
91
// Internal commands which are invoked by the server.
91
92
ctx . registerCommand ( 'runSingle' , commands . runSingle ) ;
You can’t perform that action at this time.
0 commit comments