From 22d567ac34e113be5bc30141b81ec7f89a8f413d Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 14 Oct 2022 14:53:03 -0700 Subject: [PATCH] Use new neodev config --- neovim/lua/plugins.lua | 2 +- neovim/lua/plugins/lsp.lua | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index 8a50c88..12c59b7 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -232,7 +232,7 @@ use({ -- Lua dev for vim use({ - "folke/lua-dev.nvim", + "folke/neodev.nvim", requires = "neovim/nvim-lspconfig", }) diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index 38092cc..0112da1 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -42,11 +42,8 @@ local function get_default_attach(override_capabilities) return function(client, bufnr) -- Allow overriding capabilities to avoid duplicate lsps with capabilities if override_capabilities ~= nil then - client.resolved_capabilities = vim.tbl_extend( - "force", - client.resolved_capabilities, - override_capabilities or {} - ) + client.resolved_capabilities = + vim.tbl_extend("force", client.resolved_capabilities, override_capabilities or {}) end local function buf_set_keymap(...) @@ -175,10 +172,11 @@ local function merged_capabilities() return capabilities end +--[[ local function get_luadev_config() - local luadev = utils.try_require("lua-dev") - if luadev ~= nil then - return luadev.setup({ + local neodev = utils.try_require("neodev") + if neodev ~= nil then + return neodev.setup({ -- add any options here, or leave empty to use the default settings lspconfig = { on_attach = get_default_attach(), @@ -196,6 +194,7 @@ local function get_luadev_config() return { settings = nil } end +--]] function M.config_lsp() utils.try_require("lspconfig", function(lsp_config) @@ -219,11 +218,18 @@ function M.config_lsp() }, }, }) + + -- Configure neovim dev for when sumneko_lua is installed + utils.try_require("neodev", function(neodev) + neodev.setup({}) + end) + --[[ lsp_config.sumneko_lua.setup({ capabilities = capabilities, on_attach = default_attach, - settings = get_luadev_config().settings, + -- settings = get_luadev_config().settings, }) + --]] -- Auto setup mason installed servers utils.try_require("mason-lspconfig", function(mason_lspconfig)