autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 272 forks source link

Implement textDocument/semanticTokens/full #1194

Closed martskins closed 3 years ago

martskins commented 3 years ago

This PR implements the textDocument/semanticTokens/full LSP method and removes the old "deprecated" (didn't ever really land as an accepted feature of LSP) implementation.

This also sets a default generic mapping of LSP token types to VIM highlight groups that will be merged with the user-provided language-id-specific semantic tokens mappings config which is used to decide which highlight group to assign to each token.

This is still a draft and there a few things left for this to be considered "working":

Closes #1193

martskins commented 3 years ago

I think the way to go here is use standard vim highlight groups, not LCN defined ones. If users want to define their own groups that's fine, but we have no reason to over engineer this I think. I'm gonna assume we take that path unless someone has a compelling reason not to do so.

martskins commented 3 years ago

For the sake of releasing this faster I'm gonna leave the default mappings of LSP tokens to vim highlight groups for a later PR. I'm a little undecided on what the proper mappings are so I guess it could be useful to get some more eyes on that front.