properly disable lsp signature

This commit is contained in:
siduck 2023-09-26 20:41:19 +05:30
parent d58ec3f55d
commit 1afbaef5c7
2 changed files with 12 additions and 16 deletions

View File

@ -74,11 +74,7 @@ M.ui = {
cheatsheet = { theme = "grid" }, -- simple/grid cheatsheet = { theme = "grid" }, -- simple/grid
lsp = { lsp = {
signature = { signature = true,
disabled = false,
silent = true, -- silences 'no signature help available' message
},
semantic_tokens = false, semantic_tokens = false,
}, },

View File

@ -2,27 +2,27 @@ dofile(vim.g.base46_cache .. "lsp")
require "nvchad.lsp" require "nvchad.lsp"
local M = {} local M = {}
local utils = require "core.utils"
-- export on_attach & capabilities for custom lspconfigs -- export on_attach & capabilities for custom lspconfigs
M.on_attach = function(client, bufnr) M.on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false local utils = require "core.utils"
client.server_capabilities.documentRangeFormattingProvider = false
utils.load_mappings("lspconfig", { buffer = bufnr })
-- signature stuff
local conf = utils.load_config().ui.lsp local conf = utils.load_config().ui.lsp
if conf.signature and client.server_capabilities.signatureHelpProvider then
require("nvchad.signature").setup(client)
end
-- semanticTokens -- semanticTokens
if not conf.semantic_tokens and client.supports_method "textDocument/semanticTokens" then if not conf.semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil client.server_capabilities.semanticTokensProvider = nil
end end
-- signature
if conf.signature and client.server_capabilities.signatureHelpProvider then
require("nvchad.signature").setup(client, bufnr)
end
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
utils.load_mappings("lspconfig", { buffer = bufnr })
end end
M.capabilities = vim.lsp.protocol.make_client_capabilities() M.capabilities = vim.lsp.protocol.make_client_capabilities()