diff --git a/plugins/utils/rest.nix b/plugins/utils/rest.nix index 26f48197..24595da5 100644 --- a/plugins/utils/rest.nix +++ b/plugins/utils/rest.nix @@ -415,6 +415,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { Sets up the filetype association of `.http` files to trigger treesitter support to enable `rest` functionality. ''; }; + + enableTelescope = lib.mkEnableOption "telescope integration"; }; extraConfig = cfg: { @@ -425,8 +427,17 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { Nixvim (plugins.rest): Requires the `http` parser from `plugins.treesitter`, please set `plugins.treesitter.enable`. ''; } + { + assertion = cfg.enableTelescope -> config.plugins.telescope.enable; + message = '' + Nixvim (plugins.rest): You have `plugins.rest.enableTelescope` set to true, but `plugins.telescope.enable` is false. + Either disable the telescope integration or enable telescope. + ''; + } ]; + extraConfigLua = lib.mkIf cfg.enableTelescope ''require("telescope").load_extension("rest")''; + extraPackages = [ cfg.curlPackage ]; filetype = lib.mkIf cfg.enableHttpFiletypeAssociation { diff --git a/tests/test-sources/plugins/utils/rest.nix b/tests/test-sources/plugins/utils/rest.nix index c04acadb..2e16bf6b 100644 --- a/tests/test-sources/plugins/utils/rest.nix +++ b/tests/test-sources/plugins/utils/rest.nix @@ -100,4 +100,15 @@ }; }; }; + + telescope = { + plugins = { + rest = { + enable = true; + enableTelescope = true; + }; + treesitter.enable = true; + telescope.enable = true; + }; + }; }