mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
treewide: remove with lib;
from docs and sources
This commit is contained in:
parent
0be7d8adcf
commit
7da133c3a1
2 changed files with 36 additions and 23 deletions
|
@ -1,31 +1,37 @@
|
|||
{lib}:
|
||||
with lib; let
|
||||
{lib}: let
|
||||
inherit (lib.options) mkOption mkPackageOption;
|
||||
inherit (lib.attrsets) attrNames;
|
||||
inherit (lib.types) listOf either enum submodule package;
|
||||
|
||||
diagnosticSubmodule = _: {
|
||||
options = {
|
||||
type = mkOption {
|
||||
description = "Type of diagnostic to enable";
|
||||
type = attrNames diagnostics;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
description = "Diagnostics package";
|
||||
type = types.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
||||
diagnostics = {
|
||||
langDesc,
|
||||
diagnosticsProviders,
|
||||
defaultDiagnosticsProvider,
|
||||
}:
|
||||
mkOption {
|
||||
description = "List of ${langDesc} diagnostics to enable";
|
||||
type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
||||
type = listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
||||
default = defaultDiagnosticsProvider;
|
||||
description = "List of ${langDesc} diagnostics to enable";
|
||||
};
|
||||
|
||||
mkGrammarOption = pkgs: grammar:
|
||||
mkPackageOption pkgs ["${grammar} treesitter"] {
|
||||
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
||||
};
|
||||
in {
|
||||
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue