mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
languages/html: remove null_ls usage
Remove usage of null_ls and replace it with new standards.
This commit is contained in:
parent
2ab2669143
commit
3aadd2f3ce
1 changed files with 8 additions and 17 deletions
|
@ -35,22 +35,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultDiagnosticsProvider = ["htmlhint"];
|
defaultDiagnosticsProvider = ["htmlhint"];
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
htmlhint = {
|
htmlhint = {
|
||||||
package = pkgs.htmlhint;
|
config.cmd = getExe pkgs.htmlhint;
|
||||||
nullConfig = pkg: ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.diagnostics.htmlhint.with({
|
|
||||||
command = "${pkg}/bin/htmlhint"
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.vim.languages.html = {
|
options.vim.languages.html = {
|
||||||
enable = mkEnableOption "HTML language support";
|
enable = mkEnableOption "HTML language support";
|
||||||
|
@ -91,7 +82,7 @@ in {
|
||||||
|
|
||||||
extraDiagnostics = {
|
extraDiagnostics = {
|
||||||
enable = mkEnableOption "extra HTML diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
enable = mkEnableOption "extra HTML diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||||
|
|
||||||
types = diagnostics {
|
types = diagnostics {
|
||||||
langDesc = "HTML";
|
langDesc = "HTML";
|
||||||
inherit diagnosticsProviders;
|
inherit diagnosticsProviders;
|
||||||
|
@ -99,7 +90,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
@ -117,7 +108,7 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
vim.lsp.servers =
|
vim.lsp.servers =
|
||||||
mapListToAttrs (n: {
|
mapListToAttrs (n: {
|
||||||
name = n;
|
name = n;
|
||||||
value = servers.${n};
|
value = servers.${n};
|
||||||
|
@ -140,9 +131,9 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
linters_by_ft.html = cfg.extraDiagnostics.types;
|
linters_by_ft.html = cfg.extraDiagnostics.types;
|
||||||
linters = mkMerge (map (name: {
|
linters = mkMerge (map (name: {
|
||||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
${name} = diagnosticsProviders.${name}.config;
|
||||||
})
|
})
|
||||||
cfg.extraDiagnostics.types);
|
cfg.extraDiagnostics.types);
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue