dockerfile-language-server
dockerfile-language-server copied to clipboard
Turn off semantic tokens or change their behaviour through config.
Hi.
I like this language server a lot, except for the semantic highlighting (when using Neovim). In particular, the semantic tokens overwrite the highlighting on bash commands, which I don't like, as it removes most highlighting in the bash commands. I'm no expert on language servers, but my best guess is that I can change the priority of the highlights in Neovim, but until I learn how to do that I would like to know if there is some setting that will turn off semantic tokens for this language server?
@Jacob-Flasheye NeoVim has no option to disable semantic highlighting on their end? I feel like the client should be able to just not send requests to the server.
@Jacob-Flasheye According to the documentation here, you can opt out of semantic highlighting if you wish. Putting the following code in my init.lua
seemed to do the trick for me. I hope this helps!
require("lspconfig").dockerls.setup({
on_attach = function(client, bufnr)
-- Opt out of semantic token highlighting
client.server_capabilities.semanticTokensProvider = nil
end
})