about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-09-02 14:31:36 +0900
committersefidel <contact@sefidel.net>2023-09-02 14:31:36 +0900
commitf0814fa0ec927adfad444b5c1d859a25753810a1 (patch)
tree284dcd5cb47bd1ce14c4761298153d79710cdfb4
parent8ec40af684c5ad9d78b4b2cb5bbdfa3155237ab3 (diff)
downloadnvimrc-f0814fa0ec927adfad444b5c1d859a25753810a1.tar.gz
nvimrc-f0814fa0ec927adfad444b5c1d859a25753810a1.zip
feat(packs/lspconfig)!: globally disable semantic highlighting
-rw-r--r--fnl/nvrc/packs/lspconfig.fnl9
1 files changed, 9 insertions, 0 deletions
diff --git a/fnl/nvrc/packs/lspconfig.fnl b/fnl/nvrc/packs/lspconfig.fnl
index 8add874..7bd3b23 100644
--- a/fnl/nvrc/packs/lspconfig.fnl
+++ b/fnl/nvrc/packs/lspconfig.fnl
@@ -1,3 +1,6 @@
+(import-macros {: ag!
+                : au!} :nvrc.macro.event)
+
 (local lsp (require :lspconfig))
 (local {: merge} (require :nvrc.utils))
 (local colors (require :nvrc.colors))
@@ -31,6 +34,12 @@
                      :virtual_text {:prefix "-"}
                      :signs false}))
 
+;; Disable semantic hl globally, as it usually results in worse hl
+(ag! global-no-semantic-hl
+     (au! LspAttach * (fn [args]
+                        (local client (vim.lsp.get_client_by_id args.data.client_id))
+                        (set client.server_capabilities.semanticTokensProvider nil))))
+
 ;; rust-analyzer is managed via rust-tools.nvim
 (init_lsp :hls)
 (init_lsp :gopls)