From 5798da7368bc5810bce9fe59212e4641aef00d60 Mon Sep 17 00:00:00 2001 From: Bazaah Date: Sat, 29 Oct 2022 18:27:19 +0000 Subject: [PATCH 1/2] nvim/plug/lspconfig: use cmp.defaults_capabilities/0 cmp.update_capabilities are deprecated as of hrsh7th/cmp-nvim-lsp@389f06d, so use replacement instead. --- nvim/lua/psoxizsh/plugins/config/lspconfig.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nvim/lua/psoxizsh/plugins/config/lspconfig.lua b/nvim/lua/psoxizsh/plugins/config/lspconfig.lua index 9ee1965..9207b32 100644 --- a/nvim/lua/psoxizsh/plugins/config/lspconfig.lua +++ b/nvim/lua/psoxizsh/plugins/config/lspconfig.lua @@ -10,9 +10,7 @@ return function() end -- Update LSP capabilities we send to servers to include the features supported by nvim-cmp - defaults.capabilities = cmp.update_capabilities(lspconfig.util.default_config.capabilities) - -- Dependent on a snippet manager in nvim-cmp (currently using vsnip) - defaults.capabilities.textDocument.completion.completionItem.snippetSupport = true + defaults.capabilities = cmp.default_capabilities() -- Ideally, this would be registered on some Psoxizsh.Plug.Post autocmd -- but I don't feel like refactoring psoxizsh.plugin now. From eaa530e16de293326d53d507e06fb2fa555d4e92 Mon Sep 17 00:00:00 2001 From: Bazaah Date: Sat, 29 Oct 2022 20:15:44 +0000 Subject: [PATCH 2/2] nvim/plug: lua-dev -> neodev plugin was renamed upstream, and now provides a hook for lspconfig, making our override/1 work more in line with the standard 'override the lspconfig.setup/1 param' that most of the other presets follow. --- nvim/lua/psoxizsh/lsp/preset.lua | 18 ++++++++---------- nvim/lua/psoxizsh/plugins/plug.lua | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/nvim/lua/psoxizsh/lsp/preset.lua b/nvim/lua/psoxizsh/lsp/preset.lua index ea32b89..69c1c26 100644 --- a/nvim/lua/psoxizsh/lsp/preset.lua +++ b/nvim/lua/psoxizsh/lsp/preset.lua @@ -63,17 +63,15 @@ M.Lua = { name = 'sumneko_lua', ft = 'lua', setup = function(server, settings, override) - -- Globally enable Neovim support - require('lua-dev').setup(override({ - override = function(_, o) - o.enabled = true - o.runtime = true - o.types = true - o.plugins = true - end - })) + require('neodev').setup({ lspconfig = false }) - server.setup(settings) + local defaults = { + before_init = require('neodev.lsp').before_init + } + + server.setup(override( + vim.tbl_deep_extend('keep', settings, defaults)) + ) end, } diff --git a/nvim/lua/psoxizsh/plugins/plug.lua b/nvim/lua/psoxizsh/plugins/plug.lua index 8ce0033..0638714 100644 --- a/nvim/lua/psoxizsh/plugins/plug.lua +++ b/nvim/lua/psoxizsh/plugins/plug.lua @@ -103,8 +103,8 @@ local plugins = { config = require 'psoxizsh.plugins.config.nlsp-settings' }, { 'simrat39/rust-tools.nvim' }, - { 'folke/lua-dev.nvim', - as = 'lua-dev', + { 'folke/neodev.nvim', + as = 'neodev', }, { 'vim-perl/vim-perl', ft = 'perl',