File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,21 @@ class InlayHintsFeature implements vscodelc.StaticFeature {
6767 const enabledSetting = 'editor.inlayHints.enabled' ;
6868 this . context . subscriptions . push (
6969 vscode . commands . registerCommand ( 'clangd.inlayHints.toggle' , ( ) => {
70- const current = vscode . workspace . getConfiguration ( ) . get < boolean > (
71- enabledSetting , false ) ;
70+ // This used to be a boolean, and then became a 4-state enum.
71+ var val = vscode . workspace . getConfiguration ( ) . get < boolean | string > (
72+ enabledSetting , "on" ) ;
73+ if ( val === true || val === "on" )
74+ val = "off"
75+ else if ( val === false || val === "off" )
76+ val = "on" ;
77+ else if ( val === "offUnlessPressed" )
78+ val = "onUnlessPressed" ;
79+ else if ( val == "onUnlessPressed" )
80+ val = "offUnlessPressed" ;
81+ else
82+ return ;
7283 vscode . workspace . getConfiguration ( ) . update (
73- enabledSetting , ! current , vscode . ConfigurationTarget . Global ) ;
84+ enabledSetting , val , vscode . ConfigurationTarget . Global ) ;
7485 } ) ) ;
7586 }
7687 // If the clangd server supports LSP 3.17 inlay hints, these are handled by
You can’t perform that action at this time.
0 commit comments