mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
tests/generated: validate declared lsp packages
This commit is contained in:
parent
7916df22d2
commit
0d2751b53c
2 changed files with 20 additions and 4 deletions
|
@ -186,10 +186,7 @@ let
|
||||||
else if lib.hasAttr name lspPackages.customCmd then
|
else if lib.hasAttr name lspPackages.customCmd then
|
||||||
{ inherit (lspPackages.customCmd.${name}) package cmd; }
|
{ inherit (lspPackages.customCmd.${name}) package cmd; }
|
||||||
else
|
else
|
||||||
assert lib.assertMsg (lib.elem name lspPackages.unpackaged) "LSP server ${name} is unknown";
|
{ package = null; };
|
||||||
{
|
|
||||||
package = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
generatedServers = lib.pipe ../../../generated/lspconfig-servers.json [
|
generatedServers = lib.pipe ../../../generated/lspconfig-servers.json [
|
||||||
lib.importJSON
|
lib.importJSON
|
||||||
|
|
|
@ -39,6 +39,25 @@ let
|
||||||
# The test fails if this is non-empty.
|
# The test fails if this is non-empty.
|
||||||
errors = lib.concatStringsSep "\n" (
|
errors = lib.concatStringsSep "\n" (
|
||||||
checkDeclarations (
|
checkDeclarations (
|
||||||
|
let
|
||||||
|
inherit (import ../plugins/lsp/lsp-packages.nix) unpackaged packages customCmd;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = "lsp";
|
||||||
|
declarationFile = "plugins/lsp/lsp-packages.nix";
|
||||||
|
|
||||||
|
packages = builtins.attrValues packages;
|
||||||
|
|
||||||
|
declared = unpackaged ++ lib.attrsets.attrNames (packages // customCmd);
|
||||||
|
|
||||||
|
generated = lib.pipe ../generated/lspconfig-servers.json [
|
||||||
|
lib.importJSON
|
||||||
|
(builtins.map (lib.getAttr "name"))
|
||||||
|
lib.lists.unique
|
||||||
|
];
|
||||||
|
}
|
||||||
|
)
|
||||||
|
++ checkDeclarations (
|
||||||
let
|
let
|
||||||
inherit (import ../plugins/by-name/none-ls/packages.nix lib) noPackage packaged;
|
inherit (import ../plugins/by-name/none-ls/packages.nix lib) noPackage packaged;
|
||||||
in
|
in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue