From 3aadd2f3ced2340fdd7ef3c00b9e8ad8523a08b4 Mon Sep 17 00:00:00 2001 From: Cool-Game-Dev Date: Wed, 13 Aug 2025 19:53:41 -0500 Subject: [PATCH] languages/html: remove null_ls usage Remove usage of null_ls and replace it with new standards. --- modules/plugins/languages/html.nix | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/modules/plugins/languages/html.nix b/modules/plugins/languages/html.nix index 37227918..96dc9472 100644 --- a/modules/plugins/languages/html.nix +++ b/modules/plugins/languages/html.nix @@ -35,22 +35,13 @@ }; }; }; - + defaultDiagnosticsProvider = ["htmlhint"]; diagnosticsProviders = { htmlhint = { - package = pkgs.htmlhint; - nullConfig = pkg: '' - table.insert( - ls_sources, - null_ls.builtins.diagnostics.htmlhint.with({ - command = "${pkg}/bin/htmlhint" - }) - ) - ''; + config.cmd = getExe pkgs.htmlhint; }; }; - in { options.vim.languages.html = { enable = mkEnableOption "HTML language support"; @@ -91,7 +82,7 @@ in { extraDiagnostics = { enable = mkEnableOption "extra HTML diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; - + types = diagnostics { langDesc = "HTML"; inherit diagnosticsProviders; @@ -99,7 +90,7 @@ in { }; }; }; - + config = mkIf cfg.enable (mkMerge [ (mkIf cfg.treesitter.enable { vim = { @@ -117,7 +108,7 @@ in { }) (mkIf cfg.lsp.enable { - vim.lsp.servers = + vim.lsp.servers = mapListToAttrs (n: { name = n; value = servers.${n}; @@ -140,9 +131,9 @@ in { enable = true; linters_by_ft.html = cfg.extraDiagnostics.types; linters = mkMerge (map (name: { - ${name}.cmd = getExe diagnosticsProviders.${name}.package; - }) - cfg.extraDiagnostics.types); + ${name} = diagnosticsProviders.${name}.config; + }) + cfg.extraDiagnostics.types); }; }) ]);