mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-19 13:30:17 +00:00
diagnostics/presets: init
This commit is contained in:
parent
cd45295f9c
commit
0735ee8cfd
49 changed files with 892 additions and 575 deletions
|
|
@ -6,11 +6,13 @@
|
|||
typesPlugin = import ./plugins.nix {inherit lib self;};
|
||||
typesLanguage = import ./languages.nix {inherit lib;};
|
||||
typesLsp = import ./lsp.nix {inherit lib;};
|
||||
typesDiagnostics = import ./diagnostics.nix {inherit lib;};
|
||||
customTypes = import ./custom.nix {inherit lib;};
|
||||
in {
|
||||
inherit (typesDag) dagOf;
|
||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption mkTreesitterGrammarOption;
|
||||
inherit (typesLanguage) mkGrammarOption mkTreesitterGrammarOption;
|
||||
inherit (typesLsp) mkLspPresetEnableOption;
|
||||
inherit (typesDiagnostics) mkDiagnosticsPresetEnableOption;
|
||||
inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf enumWithRename;
|
||||
}
|
||||
|
|
|
|||
11
lib/types/diagnostics.nix
Normal file
11
lib/types/diagnostics.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{lib}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
mkDiagnosticsPresetEnableOption = option: display:
|
||||
mkEnableOption ''
|
||||
the ${display} Diagnostics Provider.
|
||||
Use {option}`vim.diagnostics.nvim-lint.linters.${option}` for customization
|
||||
'';
|
||||
in {
|
||||
inherit mkDiagnosticsPresetEnableOption;
|
||||
}
|
||||
|
|
@ -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