feat(rust): add mkLspPresetOptionWithDesc and be more explicit with punctuation

This commit is contained in:
Samuel Cobb 2026-06-06 00:55:31 +01:00
commit 9852b32d41

View file

@ -1,12 +1,23 @@
{lib}: let
inherit (lib.options) mkEnableOption;
inherit (lib.options) mkOption;
mkLspPresetEnableOption = option: display: fileTypes:
mkEnableOption ''
the ${display} Language Server.
Default `filetypes = ${lib.generators.toPretty {} fileTypes}`.
Use {option}`vim.lsp.servers.${option}` for customization
'';
mkLspPresetEnableOptionWithDesc option display fileTypes "";
mkLspPresetEnableOptionWithDesc = option: display: fileTypes: description:
mkOption {
type = lib.types.bool;
default = false;
description = lib.removeSuffix "\n" (''
the ${display} Language Server.
Default `filetypes = ${lib.generators.toPretty {} fileTypes}`.
Use {option}`vim.lsp.servers.${option}` for customization.
''
+ lib.optionalString (description != "") ''
${description}
'');
};
in {
inherit mkLspPresetEnableOption;
inherit mkLspPresetEnableOption mkLspPresetEnableOptionWithDesc;
}