nix-community.nixvim/modules/diagnostics.nix
2024-09-03 22:12:33 -05:00

25 lines
535 B
Nix

{
lib,
helpers,
config,
...
}:
{
options = {
diagnostics = lib.mkOption {
type = with lib.types; attrsOf anything;
default = { };
description = "The configuration diagnostic options, provided to `vim.diagnostic.config`.";
example = {
virtual_text = false;
virtual_lines.only_current_line = true;
};
};
};
config = {
extraConfigLuaPre = lib.mkIf (config.diagnostics != { }) ''
vim.diagnostic.config(${helpers.toLuaObject config.diagnostics})
'';
};
}