Use new neodev config

This commit is contained in:
ViViDboarder 2022-10-14 14:53:03 -07:00
parent eb0320fe77
commit 22d567ac34
2 changed files with 16 additions and 10 deletions

View File

@ -232,7 +232,7 @@ use({
-- Lua dev for vim -- Lua dev for vim
use({ use({
"folke/lua-dev.nvim", "folke/neodev.nvim",
requires = "neovim/nvim-lspconfig", requires = "neovim/nvim-lspconfig",
}) })

View File

@ -42,11 +42,8 @@ local function get_default_attach(override_capabilities)
return function(client, bufnr) return function(client, bufnr)
-- Allow overriding capabilities to avoid duplicate lsps with capabilities -- Allow overriding capabilities to avoid duplicate lsps with capabilities
if override_capabilities ~= nil then if override_capabilities ~= nil then
client.resolved_capabilities = vim.tbl_extend( client.resolved_capabilities =
"force", vim.tbl_extend("force", client.resolved_capabilities, override_capabilities or {})
client.resolved_capabilities,
override_capabilities or {}
)
end end
local function buf_set_keymap(...) local function buf_set_keymap(...)
@ -175,10 +172,11 @@ local function merged_capabilities()
return capabilities return capabilities
end end
--[[
local function get_luadev_config() local function get_luadev_config()
local luadev = utils.try_require("lua-dev") local neodev = utils.try_require("neodev")
if luadev ~= nil then if neodev ~= nil then
return luadev.setup({ return neodev.setup({
-- add any options here, or leave empty to use the default settings -- add any options here, or leave empty to use the default settings
lspconfig = { lspconfig = {
on_attach = get_default_attach(), on_attach = get_default_attach(),
@ -196,6 +194,7 @@ local function get_luadev_config()
return { settings = nil } return { settings = nil }
end end
--]]
function M.config_lsp() function M.config_lsp()
utils.try_require("lspconfig", function(lsp_config) 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({ lsp_config.sumneko_lua.setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = default_attach, on_attach = default_attach,
settings = get_luadev_config().settings, -- settings = get_luadev_config().settings,
}) })
--]]
-- Auto setup mason installed servers -- Auto setup mason installed servers
utils.try_require("mason-lspconfig", function(mason_lspconfig) utils.try_require("mason-lspconfig", function(mason_lspconfig)