File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -326,8 +326,22 @@ export function toggleInlayHints(_ctx: Ctx): Cmd {
326
326
const config = vscode . workspace . getConfiguration ( "editor.inlayHints" , {
327
327
languageId : "rust" ,
328
328
} ) ;
329
- const value = ! config . get ( "enabled" ) ;
330
- await config . update ( "enabled" , value , vscode . ConfigurationTarget . Global ) ;
329
+
330
+ const value = config . get ( "enabled" ) ;
331
+ let stringValue ;
332
+ if ( typeof value === "string" ) {
333
+ stringValue = value ;
334
+ } else {
335
+ stringValue = value ? "on" : "off" ;
336
+ }
337
+ const nextValues : Record < string , string > = {
338
+ on : "off" ,
339
+ off : "on" ,
340
+ onUnlessPressed : "offUnlessPressed" ,
341
+ offUnlessPressed : "onUnlessPressed" ,
342
+ } ;
343
+ const nextValue = nextValues [ stringValue ] ?? "on" ;
344
+ await config . update ( "enabled" , nextValue , vscode . ConfigurationTarget . Global ) ;
331
345
} ;
332
346
}
333
347
You can’t perform that action at this time.
0 commit comments