Closed mkeeter closed 1 year ago
Ah, I finally found the right setting:
vim.api.nvim_set_hl(0, '@lsp.type.comment.rust', {})
This will disable LSP highlighting in Rust comments.
(:help lsp-semantic-highlight
for more details)
I'm not sure if rust-tools
wants to do this by default, but it was definitely a surprising change in behavior for me!
I got the same issue, and this is how to disable it completely.
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(client, bufnr)
client.server_capabilities.semanticTokensProvider = nil
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})
I just moved on from vimscript and coc to lua and lsp along with treesitter and I've been debugging for two days because this was driving me insane! Thanks a lot for the hint.
A simple way to disable it completely for every file so only treesitter's highlight is applied would be setting this into your init.lua:
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
vim.api.nvim_set_hl(0, group, {})
end
@bleczz is this working or you on neovim 0.9.0? :highlight
is showing all the @lsp
highlight groups as cleared. But I'm still faced with semantic tokens. Any ideas? I'm getting stuff like:
I also don't even see @lsp.type.comment.rust
listed in :highlight
...
Hi, @DieracDelta. I'm on NVIM v0.10.0-dev
@bleczz which rev?
Seems like this is LSP semantic highlighting, so it should be on by default, and can be disabled in the ways said above
Good morning! I've noticed a regression after updating to neovim 0.9.
A few seconds after startup, it switches from treesitter to LSP highlighting, which is worse (it doesn't correctly highlight docstrings or TODO):
Treesitter
LSP
I attempted to disable this with
in my configuration, but it didn't seem to work.
Any suggestions on how to disable LSP highlighting?