2024-06-21 12:55:10 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
helpers,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
options = {
|
2024-08-30 14:37:41 -05:00
|
|
|
diagnostics = lib.mkOption {
|
|
|
|
type = with lib.types; attrsOf anything;
|
2024-06-21 12:55:10 +01:00
|
|
|
default = { };
|
|
|
|
description = "The configuration diagnostic options, provided to `vim.diagnostic.config`.";
|
|
|
|
example = {
|
|
|
|
virtual_text = false;
|
|
|
|
virtual_lines.only_current_line = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2024-08-30 14:37:41 -05:00
|
|
|
extraConfigLuaPre = lib.mkIf (config.diagnostics != { }) ''
|
2024-06-21 12:55:10 +01:00
|
|
|
vim.diagnostic.config(${helpers.toLuaObject config.diagnostics})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|