lspconfig file: place default conf in a function

This will make sure that whenever the onattach or capabilities is pulled from the default lspconfig file, thosse dofile etc code ( which is now in defautls func ) wont be called , like before.
pull/2360/head^2
siduck 8 months ago
parent cb18b424b9
commit 4a8fb69157

@ -1,10 +1,6 @@
dofile(vim.g.base46_cache .. "lsp")
require "nvchad.lsp"
local M = {}
-- export on_attach & capabilities for custom lspconfigs
M.on_attach = function(client, bufnr)
local utils = require "core.utils"
local conf = utils.load_config().ui.lsp
@ -45,7 +41,11 @@ M.capabilities.textDocument.completion.completionItem = {
},
}
require("lspconfig").lua_ls.setup {
M.defaults = function()
dofile(vim.g.base46_cache .. "lsp")
require "nvchad.lsp"
require("lspconfig").lua_ls.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
@ -66,6 +66,7 @@ require("lspconfig").lua_ls.setup {
},
},
},
}
}
end
return M

@ -133,7 +133,7 @@ local default_plugins = {
require("core.utils").lazy_load "nvim-lspconfig"
end,
config = function()
require "plugins.configs.lspconfig"
require("plugins.configs.lspconfig").defaults()
end,
},

Loading…
Cancel
Save