mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-12 15:58:58 +00:00
diagnostics/presets: init
This commit is contained in:
parent
cd45295f9c
commit
0735ee8cfd
49 changed files with 892 additions and 575 deletions
|
|
@ -10,7 +10,7 @@
|
|||
inherit (lib) genAttrs;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.vue;
|
||||
|
|
@ -34,16 +34,7 @@
|
|||
};
|
||||
|
||||
defaultDiagnosticsProvider = ["biomejs"];
|
||||
diagnosticsProviders = {
|
||||
biomejs = let
|
||||
pkg = pkgs.biome;
|
||||
in {
|
||||
package = pkg;
|
||||
config = {
|
||||
cmd = getExe pkg;
|
||||
};
|
||||
};
|
||||
};
|
||||
diagnosticsProviders = ["biomejs"];
|
||||
in {
|
||||
options.vim.languages.vue = {
|
||||
enable = mkEnableOption "Vue.js language support";
|
||||
|
|
@ -97,10 +88,10 @@ in {
|
|||
defaultText = literalExpression "config.vim.languages.enableExtraDiagnostics";
|
||||
};
|
||||
|
||||
types = diagnostics {
|
||||
langDesc = "Vue.js";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
types = mkOption {
|
||||
type = listOf (enum diagnosticsProviders);
|
||||
default = defaultDiagnosticsProvider;
|
||||
description = "extra Vue.js diagnostics providers";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -136,15 +127,12 @@ in {
|
|||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.vue = cfg.extraDiagnostics.types;
|
||||
linters = mkMerge (
|
||||
map (name: {
|
||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
||||
})
|
||||
cfg.extraDiagnostics.types
|
||||
);
|
||||
vim.diagnostics = {
|
||||
presets = genAttrs cfg.extraDiagnostics.types (_: {enable = true;});
|
||||
nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.vue = cfg.extraDiagnostics.types;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue