mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-24 12:45:24 +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
|
@ -122,16 +122,20 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
warnings =
|
||||
(optional (!(cfg.json.enable || cfg.yaml.enable)) ''
|
||||
NixVim(plugins.schemastore): you have enabled the plugin, but neither `json` or `yaml` schemas are enabled.
|
||||
'')
|
||||
++ (optional (!(cfg.json.enable -> config.plugins.lsp.servers.jsonls.enable)) ''
|
||||
NixVim(plugins.schemastore): you have enabled `json` schemas, but `plugins.lsp.servers.jsonls` is not enabled.
|
||||
'')
|
||||
++ (optional (!(cfg.yaml.enable -> config.plugins.lsp.servers.yamlls.enable)) ''
|
||||
NixVim(plugins.schemastore): you have enabled `yaml` schemas, but `plugins.lsp.servers.yamlls` is not enabled.
|
||||
'');
|
||||
warnings = lib.nixvim.mkWarnings "plugins.schemastore" [
|
||||
{
|
||||
when = !(cfg.json.enable || cfg.yaml.enable);
|
||||
message = "You have enabled the plugin, but neither `json` or `yaml` schemas are enabled.";
|
||||
}
|
||||
{
|
||||
when = !(cfg.json.enable -> config.plugins.lsp.servers.jsonls.enable);
|
||||
message = "You have enabled `json` schemas, but `plugins.lsp.servers.jsonls` is not enabled.";
|
||||
}
|
||||
{
|
||||
when = !(cfg.yaml.enable -> config.plugins.lsp.servers.yamlls.enable);
|
||||
message = "You have enabled `yaml` schemas, but `plugins.lsp.servers.yamlls` is not enabled.";
|
||||
}
|
||||
];
|
||||
|
||||
plugins.lsp.servers = {
|
||||
jsonls.settings = mkIf cfg.json.enable {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue