1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-27 04:59:47 +01:00
neovim-flake/lib/types/languages.nix

32 lines
831 B
Nix
Raw Normal View History

{lib}:
with lib; let
2023-09-23 17:36:25 +02:00
diagnosticSubmodule = _: {
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 01:14:39 +01:00
diagnosticsProviders,
defaultDiagnosticsProvider,
}:
mkOption {
description = "List of ${langDesc} diagnostics to enable";
2024-03-24 01:14:39 +01:00
type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
default = defaultDiagnosticsProvider;
};
2023-04-17 23:55:27 +02:00
mkGrammarOption = pkgs: grammar:
mkPackageOption pkgs ["${grammar} treesitter"] {
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
};
}