mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-21 11:14:40 +02:00
treewide: use mkWarnings where possible
This commit is contained in:
parent
abba4af10b
commit
12e658eca8
34 changed files with 309 additions and 225 deletions
|
@ -126,13 +126,16 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
};
|
||||
in
|
||||
{
|
||||
warnings = lib.optional (cfg.enableLspFormat && cfg.settings.on_attach != null) ''
|
||||
You have enabled the lsp-format integration with none-ls.
|
||||
However, you have provided a custom value to `plugins.none-ls.settings.on_attach`.
|
||||
This means the `enableLspFormat` option will have no effect.
|
||||
Final value is:
|
||||
${lib.generators.toPretty { } cfg.settings.on_attach}
|
||||
'';
|
||||
warnings = lib.nixvim.mkWarnings "plugins.none-ls" {
|
||||
when = cfg.enableLspFormat && cfg.settings.on_attach != null;
|
||||
message = ''
|
||||
You have enabled the lsp-format integration with none-ls.
|
||||
However, you have provided a custom value to `plugins.none-ls.settings.on_attach`.
|
||||
This means the `enableLspFormat` option will have no effect.
|
||||
Final value is:
|
||||
${lib.generators.toPretty { } cfg.settings.on_attach}
|
||||
'';
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 `prettierd` 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.prettierd" {
|
||||
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.prettierd.disableTsServerFormatter` to `true`.
|
||||
- Else, to silence this warning, explicitly set the option to `false`.
|
||||
'';
|
||||
message = ''
|
||||
You have enabled the `prettierd` 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.prettierd.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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue