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
lsp = {
signature = {
disabled = false,
silent = true, -- silences 'no signature help available' message
},
signature = true,
semantic_tokens = false,
},

View File

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