mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-26 06:14:39 +00:00
feat(rust): add mkLspPresetOptionWithDesc and be more explicit with punctuation
This commit is contained in:
parent
1e9fe53cba
commit
9852b32d41
1 changed files with 18 additions and 7 deletions
|
|
@ -1,12 +1,23 @@
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkOption;
|
||||||
|
|
||||||
mkLspPresetEnableOption = option: display: fileTypes:
|
mkLspPresetEnableOption = option: display: fileTypes:
|
||||||
mkEnableOption ''
|
mkLspPresetEnableOptionWithDesc option display fileTypes "";
|
||||||
the ${display} Language Server.
|
|
||||||
Default `filetypes = ${lib.generators.toPretty {} fileTypes}`.
|
mkLspPresetEnableOptionWithDesc = option: display: fileTypes: description:
|
||||||
Use {option}`vim.lsp.servers.${option}` for customization
|
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 {
|
in {
|
||||||
inherit mkLspPresetEnableOption;
|
inherit mkLspPresetEnableOption mkLspPresetEnableOptionWithDesc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue