haskell-language-server
haskell-language-server copied to clipboard
Request textDocument/semanticTokens/full failed
Your environment
Which OS do you use? MacOS Which version of GHC do you use and how did you install it? 9.4.8 / GHCup How is your project built (alternative: link to the project)?
Which LSP client (editor/plugin) do you use?
VS Code with Haskell Plugin
Which version of HLS do you use and how did you install it?
2.5.0.0 from GHCup
Have you configured HLS in any way (especially: a hie.yaml file)?
No
What's wrong?
2024-02-16T18:21:53.031955Z | Warning | No plugin handles this "textDocument/semanticTokens/full" request.
[Error - 13:21:53] Request textDocument/semanticTokens/full failed.
Message: No plugins are available to handle this SMethod_TextDocumentSemanticTokensFull request.
Plugins installed for this method, but not available to handle this request are:
semanticTokens is disabled globally in your config.
Code: -32601
This is the error I get and however the server is running as the process shows up in my activity monitor.
Debug information
Hi, thank you for the bug report!
We recently added support for semantic tokens, but the plugin taking care of that feature is disabled by default. Unfortunately, the lsp client will still request the semantic tokens as we advertise that we are capable of the feature to the lsp client. The semantic token request fails, since the plugin isn't enabled, and we log why the request failed. However, HLS works perfectly fine, and is merely more verbose than strictly necessary.
How do I enable the support for semantic tokens?
In VSCode: File > Preferences > Settings type "semantic tokens" in the search box and one of the settings it finds should be a checkox "Enable semanticTokens plugin".
You might need to restart hls or extension host (more radical, that's what I usually do) for this change to take an effect (ctrp+shift+p - type restart extension host and pick the option it finds)
In theory, not even restarting should be necessary :sweat_smile:
Hmm, this is a bit suboptimal. I guess in an ideal world in this case we would not advertise support for semantic tokens and instead dynamically register for it when you turn it on. But that's a fair bit of work.
I made https://github.com/haskell/haskell-language-server/issues/4084 for the wider issue.
This does solve my issue. Thank You!