From 86d92a2fd212fe7d7abffe5349686f2c87c3f9bf Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 5 Oct 2021 06:59:00 +0530 Subject: [PATCH] update : capabalities cmp stuff in lspconfig | load cmp_lsp after lspconfig --- lua/plugins/configs/lspconfig.lua | 16 +--------------- lua/plugins/init.lua | 4 +++- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index 36446d1..d0c6727 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -36,21 +36,7 @@ local function on_attach(_, bufnr) end local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.documentationFormat = { "markdown", "plaintext" } -capabilities.textDocument.completion.completionItem.snippetSupport = true -capabilities.textDocument.completion.completionItem.preselectSupport = true -capabilities.textDocument.completion.completionItem.insertReplaceSupport = true -capabilities.textDocument.completion.completionItem.labelDetailsSupport = true -capabilities.textDocument.completion.completionItem.deprecatedSupport = true -capabilities.textDocument.completion.completionItem.commitCharactersSupport = true -capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } } -capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { - "documentation", - "detail", - "additionalTextEdits", - }, -} +capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) -- replace the default lsp diagnostic symbols local function lspSymbol(name, icon) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 52ccef4..8538568 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -159,6 +159,7 @@ return packer.startup(function() use { "hrsh7th/nvim-cmp", + module = "cmp", disable = not status.cmp, after = "friendly-snippets", config = override_req("nvim_cmp", "plugins.configs.cmp"), @@ -187,7 +188,8 @@ return packer.startup(function() use { "hrsh7th/cmp-nvim-lsp", disable = not status.cmp, - after = "cmp-nvim-lua", + module = "cmp_nvim_lsp", + after = "nvim-lspconfig", } use {