-
-
Notifications
You must be signed in to change notification settings - Fork 350
Semantic tokens highlighting issue (is it supported?) #1753
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
Comments
It dose support semantic tokens highlighting. Could you check your version of language-server? |
Just a short drive-by comment (can open a proper issue later), but I think there's an error in the semantic tokens: currently, identifiers that are assigned a function are labelled as local foo = function() end That is fine -- but it's also applied to table keys like {
foo = function() end,
} which I believe is wrong: table keys are not identifiers and are not called? |
I have not considered this problem carefully, but the current implementation is just showing higher priority of |
The same goes for |
Could you tell more details in a new issue? |
sure, #1767 |
I just tested this in Neovim, and all four So either the issue is with Emacs's client, or there is context missing here. Is this the whole file, or just a screenshot from a bigger file (and project)? |
I have tested the same code with 3.6.4 and the result is still the same, i.e., the last two |
Hi, I have raised an issue in lsp-mode repository and they fixed the original problem. However, after I upgraded lsp-mode and lua-language-server both to the latest version, I still found some semantic highlighting issues. The keyword lua-language-server version 3.6.10 @sumneko Just want to make sure you have seen the updated content. |
I will check it |
Is there a way to turn them off? I tried several things and none of them seem to turn return {
{
"neovim/nvim-lspconfig",
enabled = true,
opts = function(_, options)
options.servers.lua_ls.settings.Lua.hint.enable = false
options.setup = {
lua_ls = function(server, opts)
opts.on_init = function(client)
client.server_capabilities.semanticTokensProvider = nil -- turn off semantic tokens
print("LSP server initialized: " .. client.name)
print(vim.inspect(client.server_capabilities))
end
require("lspconfig")[server].setup(opts)
end,
}
return options
end,
}
} I also tried this: -- Hide all semantic highlights
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*",
callback = function()
-- Hide all semantic highlights
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
vim.api.nvim_set_hl(0, group, {})
end
end,
}) |
I figured out my problem. For anyone using neovim the setting is in Many posts will recommend this, but this did not work for me: client.server_capabilities.semanticTokensProvider = nil -- turn off semantic tokens |
I am not sure if lua-language-server supports semantic tokens highlighting. I am using emacs + lsp-mode + lua-language-server and after I enable lsp-semantics-token-mode, the tokens are colored properly. However, I noticed that if there is a long comment, then the highlighting after the comment is incorrect.
The text was updated successfully, but these errors were encountered: