2023-04-17 20:27:27 +00:00
|
|
|
{lib}:
|
|
|
|
with lib; let
|
2023-09-23 15:36:25 +00:00
|
|
|
diagnosticSubmodule = _: {
|
2023-04-17 20:27:27 +00:00
|
|
|
options = {
|
|
|
|
type = mkOption {
|
|
|
|
description = "Type of diagnostic to enable";
|
|
|
|
type = attrNames diagnostics;
|
|
|
|
};
|
|
|
|
package = mkOption {
|
|
|
|
description = "Diagnostics package";
|
|
|
|
type = types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
diagnostics = {
|
|
|
|
langDesc,
|
2024-03-24 00:14:39 +00:00
|
|
|
diagnosticsProviders,
|
|
|
|
defaultDiagnosticsProvider,
|
2023-04-17 20:27:27 +00:00
|
|
|
}:
|
|
|
|
mkOption {
|
|
|
|
description = "List of ${langDesc} diagnostics to enable";
|
2024-03-24 00:14:39 +00:00
|
|
|
type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
|
|
|
default = defaultDiagnosticsProvider;
|
2023-04-17 20:27:27 +00:00
|
|
|
};
|
2023-04-17 21:55:27 +00:00
|
|
|
|
|
|
|
mkGrammarOption = pkgs: grammar:
|
|
|
|
mkPackageOption pkgs ["${grammar} treesitter"] {
|
|
|
|
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
|
|
|
};
|
2023-04-17 20:27:27 +00:00
|
|
|
}
|