1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-19 07:21:12 +01:00

plugins/lsp: drop customCmd

These have all been upstreamed into nvim-lspconfig. Going forward, we
should continue that trend.

If any nix-specific `cmd`s aren't accepted in nvim-lspconfig, they can
be patched in Nixpkgs instead.
This commit is contained in:
Matt Sturgeon 2025-12-15 10:47:49 +00:00
parent b671eedcf4
commit 882eb84c35
4 changed files with 10 additions and 45 deletions

View file

@ -60,19 +60,10 @@ let
default = { };
};
# Combine `packages` and `customCmd` sets from `packages.nix`
# We use this set to generate the package-option defaults
serverPackages =
let
inherit (import ./packages.nix)
packages
customCmd
;
in
builtins.mapAttrs (name: v: {
inherit name;
package = v.package or v;
}) (packages // customCmd);
# Read package-option defaults from `packages.nix`
serverPackages = builtins.mapAttrs (name: package: {
inherit name package;
}) (import ./packages.nix).packages;
in
{
options.lsp = {

View file

@ -246,6 +246,7 @@
eslint = "vscode-langservers-extracted";
fennel_ls = "fennel-ls";
fish_lsp = "fish-lsp";
flow = "flow";
fortls = "fortls";
fsautocomplete = "fsautocomplete";
fstar = "fstar";
@ -270,6 +271,7 @@
"idris2Packages"
"idris2Lsp"
];
java_language_server = "java-language-server";
jdtls = "jdt-language-server";
jedi_language_server = [
"python3Packages"
@ -283,6 +285,7 @@
kotlin_language_server = "kotlin-language-server";
lean3ls = "lean4";
lemminx = "lemminx";
lexical = "lexical";
lsp_ai = "lsp-ai";
ltex = "ltex-ls";
lua_ls = "lua-language-server";
@ -303,6 +306,7 @@
];
muon = "muon";
neocmake = "neocmakelsp";
nextls = "next-ls";
nginx_language_server = "nginx-language-server";
nickel_ls = "nls";
nil_ls = "nil";
@ -444,31 +448,4 @@
zls = "zls";
zuban = "zuban";
};
# Servers that can't/don't use the provided upstream command in Nix, or packages with no upstream commands
customCmd = {
flow = {
package = "flow";
cmd = [
"flow"
"lsp"
];
};
java_language_server = {
package = "java-language-server";
cmd = [ "java-language-server" ];
};
lexical = {
package = "lexical";
cmd = [ "lexical" ];
};
nextls = {
package = "next-ls";
cmd = [
"nextls"
"--stdio"
];
};
};
}

View file

@ -224,9 +224,6 @@ let
// lib.optionalAttrs (lspPackages.packages ? ${name}) {
package = lspPackages.packages.${name};
}
// lib.optionalAttrs (lspPackages.customCmd ? ${name}) {
inherit (lspPackages.customCmd.${name}) package cmd;
}
// lspExtraArgs.${name} or { }
))
];

View file

@ -45,7 +45,7 @@ let
errors = lib.concatStringsSep "\n" (
checkDeclarations (
let
inherit (import ../modules/lsp/servers/packages.nix) unpackaged packages customCmd;
inherit (import ../modules/lsp/servers/packages.nix) unpackaged packages;
in
{
name = "lsp";
@ -53,7 +53,7 @@ let
packages = builtins.attrValues packages;
declared = unpackaged ++ lib.attrsets.attrNames (packages // customCmd);
declared = unpackaged ++ lib.attrsets.attrNames packages;
generated = builtins.attrNames (lib.importJSON ../generated/lspconfig-servers.json);
unsupported = lib.importJSON ../generated/unsupported-lspconfig-servers.json;