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.

(cherry picked from commit 12a76dd12b)
This commit is contained in:
Matt Sturgeon 2025-12-15 10:34:08 +00:00
parent 2d088ea80a
commit d8c9d8451d

View file

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