plugins/lsp: remove unused internal enabledServers.*.capabilities option

This commit is contained in:
Gaetan Lepage 2025-04-26 21:06:30 +02:00
parent 6c73350557
commit 8d8a856896
2 changed files with 0 additions and 32 deletions

View file

@ -88,15 +88,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
description = "The server's name";
};
capabilities = mkOption {
type = nullOr (attrsOf bool);
description = "Control resolved capabilities for the language server.";
default = null;
example = {
documentFormattingProvider = false;
};
};
extraOptions = mkOption {
type = attrsOf anything;
description = "Extra options for the server";
@ -187,25 +178,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
runWrappers =
wrappers: s:
if wrappers == [ ] then s else (builtins.head wrappers) (runWrappers (builtins.tail wrappers) s);
updateCapabilities =
let
servers = builtins.filter (
server: server.capabilities != null && server.capabilities != { }
) cfg.enabledServers;
in
lib.concatMapStringsSep "\n" (
server:
let
updates = lib.concatMapAttrsStringsSep "\n" (name: enabled: ''
client.server_capabilities.${name} = ${lib.nixvim.toLuaObject enabled}
'') server.capabilities;
in
''
if client.name == "${server.name}" then
${updates}
end
''
) servers;
in
''
-- LSP {{{
@ -218,8 +190,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
_M.lspOnAttach = function(client, bufnr)
${updateCapabilities}
${cfg.onAttach}
end
local __lspCapabilities = function()

View file

@ -219,14 +219,12 @@
secondServer = builtins.elemAt config.plugins.lsp.enabledServers 1;
expectedSecondServer = {
name = "second";
capabilities = null;
extraOptions = { };
};
thirdServer = builtins.elemAt config.plugins.lsp.enabledServers 2;
expectedThirdServer = {
name = "third";
capabilities = null;
extraOptions.settings.should.be = "present";
};
in