plugins/lsp: remove string support for plugins.lsp.enabledServers elements

This commit is contained in:
Gaetan Lepage 2025-04-23 09:54:47 +02:00
parent 60638182b8
commit e91333ae56

View file

@ -81,31 +81,28 @@ lib.nixvim.plugins.mkNeovimPlugin {
enabledServers = mkOption { enabledServers = mkOption {
type = type =
with types; with types;
listOf (oneOf [ listOf (submodule {
str options = {
(submodule { name = mkOption {
options = { type = str;
name = mkOption { description = "The server's name";
type = str; };
description = "The server's name";
};
capabilities = mkOption { capabilities = mkOption {
type = nullOr (attrsOf bool); type = nullOr (attrsOf bool);
description = "Control resolved capabilities for the language server."; description = "Control resolved capabilities for the language server.";
default = null; default = null;
example = { example = {
documentFormattingProvider = false; documentFormattingProvider = false;
};
};
extraOptions = mkOption {
type = attrsOf anything;
description = "Extra options for the server";
}; };
}; };
})
]); extraOptions = mkOption {
type = attrsOf anything;
description = "Extra options for the server";
};
};
});
description = "A list of enabled LSP servers. Don't use this directly."; description = "A list of enabled LSP servers. Don't use this directly.";
default = [ ]; default = [ ];
internal = true; internal = true;
@ -245,19 +242,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
}"} }"}
for i, server in ipairs(__lspServers) do for i, server in ipairs(__lspServers) do
if type(server) == "string" then local options = ${runWrappers cfg.setupWrappers "server.extraOptions"}
require("lspconfig")[server].setup(__setup)
if options == nil then
options = __setup
else else
local options = ${runWrappers cfg.setupWrappers "server.extraOptions"} options = vim.tbl_extend("keep", options, __setup)
if options == nil then
options = __setup
else
options = vim.tbl_extend("keep", options, __setup)
end
require("lspconfig")[server.name].setup(options)
end end
require("lspconfig")[server.name].setup(options)
end end
${cfg.postConfig} ${cfg.postConfig}