Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request textDocument/semanticTokens/full failed #4081

Open
QuantumStatic opened this issue Feb 16, 2024 · 7 comments
Open

Request textDocument/semanticTokens/full failed #4081

QuantumStatic opened this issue Feb 16, 2024 · 7 comments
Labels
type: support User support tickets, questions, help with setup etc.

Comments

@QuantumStatic
Copy link

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.

Screenshot 2024-02-16 at 1 34 52 PM

Debug information

@QuantumStatic QuantumStatic added status: needs triage type: support User support tickets, questions, help with setup etc. labels Feb 16, 2024
@fendor
Copy link
Collaborator

fendor commented Feb 16, 2024

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.

@QuantumStatic
Copy link
Author

How do I enable the support for semantic tokens?

@jhrcek
Copy link
Collaborator

jhrcek commented Feb 17, 2024

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)

@fendor
Copy link
Collaborator

fendor commented Feb 17, 2024

In theory, not even restarting should be necessary 😅

@michaelpj
Copy link
Collaborator

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.

@michaelpj
Copy link
Collaborator

I made #4084 for the wider issue.

@QuantumStatic
Copy link
Author

This does solve my issue. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: support User support tickets, questions, help with setup etc.
Projects
None yet
Development

No branches or pull requests

4 participants