diff --git a/plugins/by-name/yaml-schema-detect/default.nix b/plugins/by-name/yaml-schema-detect/default.nix new file mode 100644 index 00000000..48555e9a --- /dev/null +++ b/plugins/by-name/yaml-schema-detect/default.nix @@ -0,0 +1,29 @@ +{ + lib, + config, + options, + ... +}: +lib.nixvim.plugins.mkNeovimPlugin { + name = "yaml-schema-detect"; + packPathName = "yaml-schema-detect.nvim"; + package = "yaml-schema-detect-nvim"; + + description = '' + A Neovim plugin that automatically detects and applies YAML schemas for your YAML files using yaml-language-server (yamlls) + ''; + + extraConfig = cfg: { + warnings = lib.nixvim.mkWarnings "plugins.yaml-schema-detect" [ + { + when = !config.plugins.which-key.enable; + message = '' + This plugin requires `plugins.which-key` to be enabled + ${options.plugins.which-key.enable} = true; + ''; + } + ]; + }; + + maintainers = [ lib.maintainers.FKouhai ]; +} diff --git a/tests/test-sources/plugins/by-name/yaml-schema-detect/default.nix b/tests/test-sources/plugins/by-name/yaml-schema-detect/default.nix new file mode 100644 index 00000000..86593c6b --- /dev/null +++ b/tests/test-sources/plugins/by-name/yaml-schema-detect/default.nix @@ -0,0 +1,8 @@ +{ + # empty test case is not needed since having it would make the warning throw an error + # this plugin requires which-key + combine-plugins = { + plugins.which-key.enable = true; + plugins.yaml-schema-detect.enable = true; + }; +}