mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-13 16:25:04 +00:00
26 lines
810 B
Nix
26 lines
810 B
Nix
{lib}: let
|
|
inherit (lib.generators) toPretty;
|
|
inherit (lib.options) mkOption;
|
|
inherit (lib.strings) removeSuffix optionalString;
|
|
inherit (lib.types) bool;
|
|
|
|
mkLspPresetEnableOption = option: display: fileTypes:
|
|
mkLspPresetEnableOptionWithDesc option display fileTypes "";
|
|
|
|
mkLspPresetEnableOptionWithDesc = option: display: fileTypes: description:
|
|
mkOption {
|
|
type = bool;
|
|
default = false;
|
|
description = removeSuffix "\n" (''
|
|
The ${display} Language Server.
|
|
Default `filetypes = ${toPretty {} fileTypes}`.
|
|
Use {option}`vim.lsp.servers.${option}` for customization.
|
|
''
|
|
+ optionalString (description != "") ''
|
|
|
|
${description}
|
|
'');
|
|
};
|
|
in {
|
|
inherit mkLspPresetEnableOption mkLspPresetEnableOptionWithDesc;
|
|
}
|