diff --git a/plugins/utils/refactoring.nix b/plugins/utils/refactoring.nix index 1000a5e8..33eed574 100644 --- a/plugins/utils/refactoring.nix +++ b/plugins/utils/refactoring.nix @@ -22,6 +22,24 @@ helpers.neovim-plugin.mkNeovimPlugin config { "extractVarStatements" ]; + extraOptions = { + enableTelescope = mkEnableOption "telescope integration"; + }; + + extraConfig = cfg: { + assertions = [ + { + assertion = cfg.enableTelescope -> config.plugins.telescope.enable; + message = '' + Nixvim: You have enabled the `telescope` integration with refactoring-nvim. + However, you have not enabled the `telescope` plugin itself (`plugins.telescope.enable = true`). + ''; + } + ]; + + plugins.telescope.enabledExtensions = mkIf cfg.enableTelescope [ "refactoring" ]; + }; + settingsOptions = with helpers.nixvimTypes; { prompt_func_return_type = helpers.defaultNullOpts.mkAttrsOf bool diff --git a/tests/test-sources/plugins/utils/refactoring.nix b/tests/test-sources/plugins/utils/refactoring.nix index 6caf7731..77ba7feb 100644 --- a/tests/test-sources/plugins/utils/refactoring.nix +++ b/tests/test-sources/plugins/utils/refactoring.nix @@ -28,6 +28,15 @@ }; }; + withTelescope = { + plugins.telescope.enable = true; + + plugins.refactoring = { + enable = true; + enableTelescope = true; + }; + }; + defaults = { plugins.refactoring = { enable = true;