feat: add full semantic token support#492
Conversation
|
Can you post some before and afters of your editor showcasing the feature? |
|
How the highlighting works without the feature: Here's how it looks like with the semantic token support: We can see in the second screenshot that the "document" parameter is highlighted differently(the :Inspect from neovim is on "document" parameter). Next-ls has sent additional information to the editor for this token I'll leave two articles on the semantic highlighting from VSCode: And jetbrains: |
|
A nice usage could be adding a different type to macros such as Note that we would want to be careful here since all operators could easily be interpreted as macros as well breaking all colorschemes in the process. We would probably want to exclude any Kernel level macros from this. |


Opening this to start a discussion on what should be a part of this PR.
Currently all this does is add support for semanticTokens/full and parameters on def/defp/defmacro/defmacrop.
On my wishlist is to add support for the range and delta requests as well(which are on right now by the provider).
For the delta requests I might store the old result of the previous request on the lsp assigns which should be okay.
I need some ideas on what else we could add other than parameters. I'll take a look at other implementations and what they add. The protocol defines a list of default types and modifiers but bear in mind that we can add our own custom ones to the legend sent at the initialization part.