File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,24 @@ handleResolveInlayHint :: Handlers (LspT c StaticLsM)
112112handleResolveInlayHint = LSP. requestHandler LSP. SMethod_InlayHintResolve $ \ _ _ -> do
113113 pure ()
114114
115+ -- The lsp library (>=2.7.0.1) unconditionally advertises `semanticTokensProvider`
116+ -- in initialize, even when no semantic-token handlers are registered. Clients
117+ -- (notably Neovim's built-in LSP client) then send `textDocument/semanticTokens/*`
118+ -- requests, which fall through to the library's `missingRequestHandler` and are
119+ -- logged at Error severity -- the default logger surfaces those as `window/showMessage`
120+ -- popups. Register stub handlers that return Null so the requests resolve quietly.
121+ handleSemanticTokensFull :: Handlers (LspT c StaticLsM )
122+ handleSemanticTokensFull = LSP. requestHandler LSP. SMethod_TextDocumentSemanticTokensFull $ \ _ res ->
123+ res $ Right $ InR Null
124+
125+ handleSemanticTokensFullDelta :: Handlers (LspT c StaticLsM )
126+ handleSemanticTokensFullDelta = LSP. requestHandler LSP. SMethod_TextDocumentSemanticTokensFullDelta $ \ _ res ->
127+ res $ Right $ InR $ InR Null
128+
129+ handleSemanticTokensRange :: Handlers (LspT c StaticLsM )
130+ handleSemanticTokensRange = LSP. requestHandler LSP. SMethod_TextDocumentSemanticTokensRange $ \ _ res ->
131+ res $ Right $ InR Null
132+
115133handleReferencesRequest :: Handlers (LspT c StaticLsM )
116134handleReferencesRequest = LSP. requestHandler LSP. SMethod_TextDocumentReferences $ \ req res -> do
117135 let params = req. _params
Original file line number Diff line number Diff line change @@ -227,6 +227,9 @@ serverDef options logger = do
227227 , handleDocumentSymbols
228228 , handleCompletion
229229 , handleCompletionItemResolve
230+ , handleSemanticTokensFull
231+ , handleSemanticTokensFullDelta
232+ , handleSemanticTokensRange
230233 ]
231234 <> (if options. provideInlays then [handleInlayHintRequest options, handleResolveInlayHint] else [] )
232235 <> ( case options. fourmoluCommand of
You can’t perform that action at this time.
0 commit comments