makeSemanticTokens should use the same legend as inferServerCapabilities
- Dominant language
- Haskell
- Stars
- 423
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
Somewhat confusingly, LSP (the protocol) has two places where the token types appear for semantic tokens, in the client caps and server caps. The indices in the encoding of the tokens are relative to the legend provided by the server, not the client. For this library, this is constructed in inferServerCapabilities.
For the moment it makes more sense (to me) that makeSemanticTokens hard codes the legend as the same as constructed in inferServerCapabilities, if only to avoid confusion, and maybe discards tokens which are not supported by the client..
This is not that high priority, it just bit me (I was passing in the client caps, and it seemed to work for a while) and I thought it might be reasonable to make the API robust against user error.
Contributor guide
Assessment
This issue has not been assessed yet.