fix: lsp config

This commit is contained in:
Fábio André Damas 2025-09-28 16:40:52 +00:00
parent 2b05047eb9
commit f8ad1ab559
2 changed files with 22 additions and 21 deletions

View file

@ -25,12 +25,13 @@ return {
local name = vim.fn.fnamemodify(v, ':t:r')
local cfg = require("lsp_extend/" .. name)
if vim.lsp.config[name] ~= nil then
vim.lsp.config(name, vim.tbl_deep_extend("force", cfg, {
settings = { [name] = { capabilities } }
}))
if cfg ~= nil and next(cfg) ~= nil then
vim.lsp.config(name, cfg)
end
vim.lsp.enable(name)
else
vim.notify("LSP server " .. name .. " does not have a setup function", vim.log.levels.ERROR)
vim.notify("LSP server " .. name .. " configuration could not load from lspconfig.",
vim.log.levels.ERROR)
end
end
end