@@ -53,11 +53,10 @@ class InlayHintsFeature implements vscodelc.StaticFeature {
5353 const serverCapabilities : vscodelc . ServerCapabilities &
5454 { clangdInlayHintsProvider ?: boolean , inlayHintProvider ?: any } =
5555 capabilities ;
56- // If the clangd server supports LSP 3.17 inlay hints, these are handled by
57- // the vscode-languageclient library - don't send custom requests too!
58- if ( ! serverCapabilities . clangdInlayHintsProvider ||
59- serverCapabilities . inlayHintProvider )
60- return ;
56+ vscode . commands . executeCommand (
57+ 'setContext' , 'clangd.inlayHints.supported' ,
58+ serverCapabilities . clangdInlayHintsProvider ||
59+ serverCapabilities . inlayHintProvider ) ;
6160 if ( ! this . commandRegistered ) {
6261 // The command provides a quick way to toggle inlay hints
6362 // (key-bindable).
@@ -74,10 +73,15 @@ class InlayHintsFeature implements vscodelc.StaticFeature {
7473 enabledSetting , ! current , vscode . ConfigurationTarget . Global ) ;
7574 } ) ) ;
7675 }
76+ // If the clangd server supports LSP 3.17 inlay hints, these are handled by
77+ // the vscode-languageclient library - don't send custom requests too!
78+ if ( ! serverCapabilities . clangdInlayHintsProvider ||
79+ serverCapabilities . inlayHintProvider )
80+ return ;
7781 this . context . subscriptions . push ( vscode . languages . registerInlayHintsProvider (
7882 clangdDocumentSelector , new Provider ( this . context ) ) ) ;
7983 }
80-
84+ getState ( ) : vscodelc . FeatureState { return { kind : 'static' } ; }
8185 dispose ( ) { }
8286}
8387
0 commit comments