plugins/lsp: use a no-default option when there is no default provided

This commit is contained in:
Matt Sturgeon 2024-10-10 19:43:40 +01:00
parent 0d2751b53c
commit 88302aa17a
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 26 additions and 14 deletions

View file

@ -179,15 +179,6 @@ let
lspPackages = import ../lsp-packages.nix;
getLspPackage =
name:
if lib.hasAttr name lspPackages.packages then
{ package = lspPackages.packages.${name}; }
else if lib.hasAttr name lspPackages.customCmd then
{ inherit (lspPackages.customCmd.${name}) package cmd; }
else
{ package = null; };
generatedServers = lib.pipe ../../../generated/lspconfig-servers.json [
lib.importJSON
(lib.map (
@ -200,8 +191,13 @@ let
inherit name;
description = desc;
}
// (getLspPackage name)
// (lspExtraArgs.${name} or { })
// lib.optionalAttrs (lspPackages.packages ? ${name}) {
package = lspPackages.packages.${name};
}
// lib.optionalAttrs (lspPackages.customCmd ? ${name}) {
inherit (lspPackages.customCmd.${name}) package cmd;
}
// lspExtraArgs.${name} or { }
))
];
in