mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-18 15:01:13 +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:
parent
753f7640d6
commit
12a76dd12b
1 changed files with 4 additions and 2 deletions
|
|
@ -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 = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue