File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 300300 "default" : true ,
301301 "markdownDescription" : " Check with all features (will be passed as `--all-features`)"
302302 },
303+ "rust-analyzer.inlayHints.enable" : {
304+ "type" : " boolean" ,
305+ "default" : true ,
306+ "description" : " Disable all inlay hints"
307+ },
303308 "rust-analyzer.inlayHints.typeHints" : {
304309 "type" : " boolean" ,
305310 "default" : true ,
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export class Config {
9494
9595 get inlayHints ( ) {
9696 return {
97+ enable : this . get < boolean > ( "inlayHints.enable" ) ,
9798 typeHints : this . get < boolean > ( "inlayHints.typeHints" ) ,
9899 parameterHints : this . get < boolean > ( "inlayHints.parameterHints" ) ,
99100 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) {
1010 const maybeUpdater = {
1111 updater : null as null | HintsUpdater ,
1212 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+
2020 await sleep ( 100 ) ;
2121 if ( this . updater ) {
2222 this . updater . syncCacheAndRenderHints ( ) ;
You can’t perform that action at this time.
0 commit comments