mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/lsp: remove unused internal enabledServers.*.capabilities option
This commit is contained in:
parent
6c73350557
commit
8d8a856896
2 changed files with 0 additions and 32 deletions
|
@ -88,15 +88,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
description = "The server's name";
|
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 {
|
extraOptions = mkOption {
|
||||||
type = attrsOf anything;
|
type = attrsOf anything;
|
||||||
description = "Extra options for the server";
|
description = "Extra options for the server";
|
||||||
|
@ -187,25 +178,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
runWrappers =
|
runWrappers =
|
||||||
wrappers: s:
|
wrappers: s:
|
||||||
if wrappers == [ ] then s else (builtins.head wrappers) (runWrappers (builtins.tail 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
|
in
|
||||||
''
|
''
|
||||||
-- LSP {{{
|
-- LSP {{{
|
||||||
|
@ -218,8 +190,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
|
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
|
||||||
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
|
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
|
||||||
_M.lspOnAttach = function(client, bufnr)
|
_M.lspOnAttach = function(client, bufnr)
|
||||||
${updateCapabilities}
|
|
||||||
|
|
||||||
${cfg.onAttach}
|
${cfg.onAttach}
|
||||||
end
|
end
|
||||||
local __lspCapabilities = function()
|
local __lspCapabilities = function()
|
||||||
|
|
|
@ -219,14 +219,12 @@
|
||||||
secondServer = builtins.elemAt config.plugins.lsp.enabledServers 1;
|
secondServer = builtins.elemAt config.plugins.lsp.enabledServers 1;
|
||||||
expectedSecondServer = {
|
expectedSecondServer = {
|
||||||
name = "second";
|
name = "second";
|
||||||
capabilities = null;
|
|
||||||
extraOptions = { };
|
extraOptions = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
thirdServer = builtins.elemAt config.plugins.lsp.enabledServers 2;
|
thirdServer = builtins.elemAt config.plugins.lsp.enabledServers 2;
|
||||||
expectedThirdServer = {
|
expectedThirdServer = {
|
||||||
name = "third";
|
name = "third";
|
||||||
capabilities = null;
|
|
||||||
extraOptions.settings.should.be = "present";
|
extraOptions.settings.should.be = "present";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue