mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-19 21:46:32 +00:00
diagnostics/presets: init
This commit is contained in:
parent
cd45295f9c
commit
0735ee8cfd
49 changed files with 892 additions and 575 deletions
|
|
@ -1,32 +1,5 @@
|
|||
{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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
diagnostics = {
|
||||
langDesc,
|
||||
diagnosticsProviders,
|
||||
defaultDiagnosticsProvider,
|
||||
}:
|
||||
mkOption {
|
||||
type = listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
||||
default = defaultDiagnosticsProvider;
|
||||
description = "List of ${langDesc} diagnostics to enable";
|
||||
};
|
||||
inherit (lib.options) mkPackageOption;
|
||||
|
||||
mkGrammarOption = pkgs: grammar:
|
||||
mkPackageOption pkgs ["${grammar} treesitter"] {
|
||||
|
|
@ -45,5 +18,5 @@
|
|||
nullable = true;
|
||||
};
|
||||
in {
|
||||
inherit diagnostics diagnosticSubmodule mkGrammarOption mkTreesitterGrammarOption;
|
||||
inherit mkGrammarOption mkTreesitterGrammarOption;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue