treewide: use mkWarnings where possible

This commit is contained in:
Gaetan Lepage 2025-01-29 14:16:00 +01:00
parent abba4af10b
commit 12e658eca8
34 changed files with 309 additions and 225 deletions

View file

@ -23,16 +23,18 @@ in
};
config = lib.mkIf cfg.enable {
warnings =
lib.optional (opt.disableTsServerFormatter.highestPrio == defaultPrio && ts-ls-cfg.enable)
''
You have enabled the `prettier` formatter in none-ls.
You have also enabled the `ts_ls` language server which also brings a formatting feature.
warnings = lib.nixvim.mkWarnings "plugins.none-ls.sources.formatting.prettier" {
when = opt.disableTsServerFormatter.highestPrio == defaultPrio && ts-ls-cfg.enable;
- To disable the formatter built-in the `ts_ls` language server, set
`plugins.none-ls.sources.formatting.prettier.disableTsServerFormatter` to `true`.
- Else, to silence this warning, explicitly set the option to `false`.
'';
message = ''
You have enabled the `prettier` formatter in none-ls.
You have also enabled the `ts_ls` language server which also brings a formatting feature.
- To disable the formatter built-in the `ts_ls` language server, set
`plugins.none-ls.sources.formatting.prettier.disableTsServerFormatter` to `true`.
- Else, to silence this warning, explicitly set the option to `false`.
'';
};
plugins.lsp.servers.ts_ls =
lib.mkIf (cfg.enable && ts-ls-cfg.enable && cfg.disableTsServerFormatter)