File tree 3 files changed +13
-7
lines changed 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 300
300
"default" : true ,
301
301
"markdownDescription" : " Check with all features (will be passed as `--all-features`)"
302
302
},
303
+ "rust-analyzer.inlayHints.enable" : {
304
+ "type" : " boolean" ,
305
+ "default" : true ,
306
+ "description" : " Disable all inlay hints"
307
+ },
303
308
"rust-analyzer.inlayHints.typeHints" : {
304
309
"type" : " boolean" ,
305
310
"default" : true ,
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export class Config {
94
94
95
95
get inlayHints ( ) {
96
96
return {
97
+ enable : this . get < boolean > ( "inlayHints.enable" ) ,
97
98
typeHints : this . get < boolean > ( "inlayHints.typeHints" ) ,
98
99
parameterHints : this . get < boolean > ( "inlayHints.parameterHints" ) ,
99
100
chainingHints : this . get < boolean > ( "inlayHints.chainingHints" ) ,
Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ export function activateInlayHints(ctx: Ctx) {
10
10
const maybeUpdater = {
11
11
updater : null as null | HintsUpdater ,
12
12
async onConfigChange ( ) {
13
- if (
14
- ! ctx . config . inlayHints . typeHints &&
15
- ! ctx . config . inlayHints . parameterHints &&
16
- ! ctx . config . inlayHints . chainingHints
17
- ) {
18
- return this . dispose ( ) ;
19
- }
13
+ const anyEnabled = ctx . config . inlayHints . typeHints
14
+ || ctx . config . inlayHints . parameterHints
15
+ || ctx . config . inlayHints . chainingHints ;
16
+ const enabled = ctx . config . inlayHints . enable && anyEnabled ;
17
+
18
+ if ( ! enabled ) return this . dispose ( ) ;
19
+
20
20
await sleep ( 100 ) ;
21
21
if ( this . updater ) {
22
22
this . updater . syncCacheAndRenderHints ( ) ;
You can’t perform that action at this time.
0 commit comments