modules/diagnostic: init

This commit is contained in:
Matt Sturgeon 2024-06-21 12:55:10 +01:00
parent 66b23fff80
commit 39d1c95061
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 27 additions and 0 deletions

View file

@ -4,6 +4,7 @@
./clipboard.nix ./clipboard.nix
./colorscheme.nix ./colorscheme.nix
./commands.nix ./commands.nix
./diagnostic.nix
./doc.nix ./doc.nix
./editorconfig.nix ./editorconfig.nix
./filetype.nix ./filetype.nix

26
modules/diagnostic.nix Normal file
View file

@ -0,0 +1,26 @@
{
lib,
helpers,
config,
...
}:
with lib;
{
options = {
diagnostics = mkOption {
type = with 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 = optionalString (config.diagnostics != { }) ''
vim.diagnostic.config(${helpers.toLuaObject config.diagnostics})
'';
};
}