File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 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 {
326326 const config = vscode . workspace . getConfiguration ( "editor.inlayHints" , {
327327 languageId : "rust" ,
328328 } ) ;
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 ) ;
331345 } ;
332346}
333347
You can’t perform that action at this time.
0 commit comments