fix(lspconfig): make opts a function (#3311)

`LazyVim.config` gets evaluated during the parsing phase with `opts`
as a table (thus not taking into account changes made in the user's
personal configuration for the icons), so make `opts` a function to
defer the evaluation until the plugin loads.
This commit is contained in:
Iordanis Petkakis 2024-05-26 17:06:15 +03:00 committed by GitHub
parent b3373f3428
commit 7aa37064a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,7 +10,8 @@ return {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
}, },
---@class PluginLspOpts ---@class PluginLspOpts
opts = { opts = function()
return {
-- options for vim.diagnostic.config() -- options for vim.diagnostic.config()
---@type vim.diagnostic.Opts ---@type vim.diagnostic.Opts
diagnostics = { diagnostics = {
@ -106,7 +107,8 @@ return {
-- Specify * to use this function as a fallback for any server -- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end, -- ["*"] = function(server, opts) end,
}, },
}, }
end,
---@param opts PluginLspOpts ---@param opts PluginLspOpts
config = function(_, opts) config = function(_, opts)
if LazyVim.has("neoconf.nvim") then if LazyVim.has("neoconf.nvim") then