1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-18 06:51:12 +01:00

modules/lsp/servers: simplify displayName and packageName

Move the `let in` block defining `displayName` and `packageName` up so
it doesn't have to deal with the module arg `name` shadowing `args.name`.

This simplifies the implementation and reduces repetition.
This commit is contained in:
Matt Sturgeon 2025-12-15 10:34:08 +00:00
parent 753f7640d6
commit 12a76dd12b

View file

@ -4,6 +4,10 @@
package ? null, package ? null,
config ? null, config ? null,
}@args: }@args:
let
displayName = name;
packageName = package.name or args.name or "language server";
in
{ {
lib, lib,
name, name,
@ -13,8 +17,6 @@
}: }:
let let
inherit (lib) types; inherit (lib) types;
displayName = args.name or "the language server";
packageName = package.name or (lib.strings.removePrefix "the " displayName);
in in
{ {
options = { options = {