Skip to content

Commit 8d8a856

Browse files
committed
plugins/lsp: remove unused internal enabledServers.*.capabilities option
1 parent 6c73350 commit 8d8a856

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

plugins/lsp/default.nix

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
8888
description = "The server's name";
8989
};
9090

91-
capabilities = mkOption {
92-
type = nullOr (attrsOf bool);
93-
description = "Control resolved capabilities for the language server.";
94-
default = null;
95-
example = {
96-
documentFormattingProvider = false;
97-
};
98-
};
99-
10091
extraOptions = mkOption {
10192
type = attrsOf anything;
10293
description = "Extra options for the server";
@@ -187,25 +178,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
187178
runWrappers =
188179
wrappers: s:
189180
if wrappers == [ ] then s else (builtins.head wrappers) (runWrappers (builtins.tail wrappers) s);
190-
updateCapabilities =
191-
let
192-
servers = builtins.filter (
193-
server: server.capabilities != null && server.capabilities != { }
194-
) cfg.enabledServers;
195-
in
196-
lib.concatMapStringsSep "\n" (
197-
server:
198-
let
199-
updates = lib.concatMapAttrsStringsSep "\n" (name: enabled: ''
200-
client.server_capabilities.${name} = ${lib.nixvim.toLuaObject enabled}
201-
'') server.capabilities;
202-
in
203-
''
204-
if client.name == "${server.name}" then
205-
${updates}
206-
end
207-
''
208-
) servers;
209181
in
210182
''
211183
-- LSP {{{
@@ -218,8 +190,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
218190
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
219191
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
220192
_M.lspOnAttach = function(client, bufnr)
221-
${updateCapabilities}
222-
223193
${cfg.onAttach}
224194
end
225195
local __lspCapabilities = function()

tests/test-sources/plugins/lsp/_lsp.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,12 @@
219219
secondServer = builtins.elemAt config.plugins.lsp.enabledServers 1;
220220
expectedSecondServer = {
221221
name = "second";
222-
capabilities = null;
223222
extraOptions = { };
224223
};
225224

226225
thirdServer = builtins.elemAt config.plugins.lsp.enabledServers 2;
227226
expectedThirdServer = {
228227
name = "third";
229-
capabilities = null;
230228
extraOptions.settings.should.be = "present";
231229
};
232230
in

0 commit comments

Comments
 (0)