From 0c9e0eb164c28becd45c36d3d459996bc0332ea4 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Wed, 4 Jan 2023 13:54:49 +0530 Subject: [PATCH] nvim: lsp: Disable semantic token highlighting It produces somewhat bad syntax highlighting in some cases. For example, in typescript, the variable and it's type annotation get the same colour. --- nvim/.config/nvim/lua/lsp.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 0aebfe4..27f776b 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -157,6 +157,9 @@ local on_attach = function(client, bufnr) end end + -- Opt out of semantic highlighting + client.server_capabilities.semanticTokensProvider = nil + if client.server_capabilities.codeLensProvider or client.server_capabilities.documentHighlightProvider then if client.server_capabilities.codeLensProvider then vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, {