mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
modules/diagnostic: rename diagnostic.config
-> diagnostic.settings
Follow up to #3226, in line with the decisions made in #3254.
This commit is contained in:
parent
405a564f3d
commit
1df98b6636
4 changed files with 14 additions and 8 deletions
|
@ -8,7 +8,7 @@ let
|
|||
in
|
||||
{
|
||||
options.diagnostic = {
|
||||
config = lib.mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types; attrsOf anything;
|
||||
default = { };
|
||||
description = "The configuration diagnostic options, provided to `vim.diagnostic.config`.";
|
||||
|
@ -21,12 +21,18 @@ in
|
|||
|
||||
imports = [
|
||||
# TODO: Added 2025-04-26; remove after 25.05
|
||||
(lib.mkRenamedOptionModule [ "diagnostics" ] [ "diagnostic" "config" ])
|
||||
(lib.mkRenamedOptionModule [ "diagnostics" ] [ "diagnostic" "settings" ])
|
||||
|
||||
# TODO: Added 2025-04-30;
|
||||
# The above rename initially renamed `diagnostics` -> `diagnostic.config`
|
||||
# This rename covers any users who migrated between 2025-04-26 and 2025-04-30
|
||||
# We can consider removing this rename earlier than usual
|
||||
(lib.mkRenamedOptionModule [ "diagnostic" "config" ] [ "diagnostic" "settings" ])
|
||||
];
|
||||
|
||||
config = {
|
||||
extraConfigLuaPre = lib.mkIf (cfg.config != { }) ''
|
||||
vim.diagnostic.config(${lib.nixvim.toLuaObject cfg.config})
|
||||
extraConfigLuaPre = lib.mkIf (cfg.settings != { }) ''
|
||||
vim.diagnostic.config(${lib.nixvim.toLuaObject cfg.settings})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
]
|
||||
[
|
||||
"diagnostic"
|
||||
"config"
|
||||
"settings"
|
||||
"virtual_lines"
|
||||
"only_current_line"
|
||||
]
|
||||
|
@ -34,6 +34,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
extraConfig = {
|
||||
# Strongly recommended by the plugin, to avoid duplication.
|
||||
diagnostic.config.virtual_text = mkDefault false;
|
||||
diagnostic.settings.virtual_text = mkDefault false;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
example = {
|
||||
diagnostic.config = {
|
||||
diagnostic.settings = {
|
||||
virtual_text = false;
|
||||
virtual_lines.current_line = true;
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
example = {
|
||||
plugins.lsp-lines.enable = true;
|
||||
|
||||
diagnostic.config.virtual_lines = {
|
||||
diagnostic.settings.virtual_lines = {
|
||||
only_current_line = true;
|
||||
highlight_whole_line = false;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue