-
Notifications
You must be signed in to change notification settings - Fork 43
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
Feat: Add groups for LSP semantic tokens #52
Conversation
It'll probably be better to change the notation to |
TODO: use the other syntax and add all these tokens https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens |
This comment was marked as outdated.
This comment was marked as outdated.
It seems like these tokens are new, tokyonight added them recently. |
This PR seems to be the culprit. |
It would have been really nice if all of the Neovim colorschemes were just forks of some core repository, and then just override colors as the developers see fit... |
I am going to leave this open until there is a confirmation (from either you or me) that these groups are correct. I suspect they are, I just don't have the time now to double-check. |
According to the docs we can simply disable all tokens, but I thought it would be useful to have easy access to this variables. Just in case anyone needs it: for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
vim.api.nvim_set_hl(0, group, {})
end
Following that script provided by neovim team, the following seems to be "official" groups, but I guess things may change until a stable release:
The docs also say that many groups are linked by default to other highlight groups:
I think we can drop the other notation from this PR, keep folke's changes and add the other possible tokens commented out as an "easy access" for future improvements. What do you think @AlexvZyl? |
Yes, I agree with you. You mind doing that? |
Sure, I'll get this done later today or tomorrow. |
Beautiful, thanks for the work! |
There is a much easier way to disable semantic tokens: vim.api.vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
client.server_capabilities.semanticTokensProvider = nil
end,
group = vim.api.nvim_create_augroup('LspAug', {}),
}) I've read somewhere that it is a 'chosen' way to do that instead of messing with highlight groups. |
If you can find this source you are more than welcome to open a PR with the changes. We are currently not doing that since we are basically doing what Folke is doing over at tokyonight. |
I'm not sure what I am doing here, but my Lua code was getting white, so I linked some highlight groups to Treesitter ones.