From d58ec3f55d34fe9339e0d0eb8645e5bbbaba234e Mon Sep 17 00:00:00 2001 From: siduck Date: Tue, 26 Sep 2023 18:51:34 +0530 Subject: [PATCH] properly disable lsp signature https://github.com/NvChad/ui/pull/188#issuecomment-1735510051 --- lua/core/default_config.lua | 3 ++- lua/plugins/configs/lspconfig.lua | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 9c9bad1..75763e7 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -13,7 +13,6 @@ M.ui = { theme_toggle = { "onedark", "one_light" }, theme = "onedark", -- default theme transparency = false, - lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens -- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify" @@ -79,6 +78,8 @@ M.ui = { disabled = false, silent = true, -- silences 'no signature help available' message }, + + semantic_tokens = false, }, term = { diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index 18e84ad..61d80ca 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -12,11 +12,15 @@ M.on_attach = function(client, bufnr) utils.load_mappings("lspconfig", { buffer = bufnr }) - if client.server_capabilities.signatureHelpProvider then + -- signature stuff + local conf = utils.load_config().ui.lsp + + if conf.signature and client.server_capabilities.signatureHelpProvider then require("nvchad.signature").setup(client) end - if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then + -- semanticTokens + if not conf.semantic_tokens and client.supports_method "textDocument/semanticTokens" then client.server_capabilities.semanticTokensProvider = nil end end