Revert "Factor out diagnostics like LSPs"

This commit is contained in:
Ching Pei Yang 2026-06-12 22:22:21 +02:00 committed by GitHub
commit 6cddf8560b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 662 additions and 1023 deletions

View file

@ -6,13 +6,11 @@
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) mkGrammarOption mkTreesitterGrammarOption;
inherit (typesLanguage) diagnostics mkGrammarOption mkTreesitterGrammarOption;
inherit (typesLsp) mkLspPresetEnableOption;
inherit (typesDiagnostics) mkDiagnosticsPresetEnableOption;
inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf enumWithRename;
}

View file

@ -1,11 +0,0 @@
{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;
}

View file

@ -1,5 +1,32 @@
{lib}: let
inherit (lib.options) mkPackageOption;
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";
};
mkGrammarOption = pkgs: grammar:
mkPackageOption pkgs ["${grammar} treesitter"] {
@ -18,5 +45,5 @@
nullable = true;
};
in {
inherit mkGrammarOption mkTreesitterGrammarOption;
inherit diagnostics diagnosticSubmodule mkGrammarOption mkTreesitterGrammarOption;
}