Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: option to enable refactor.nvim's telescope extension #1218

Closed
MattSturgeon opened this issue Mar 6, 2024 · 3 comments · Fixed by #1557
Closed

feature: option to enable refactor.nvim's telescope extension #1218

MattSturgeon opened this issue Mar 6, 2024 · 3 comments · Fixed by #1557

Comments

@MattSturgeon
Copy link
Member

refactoring.nvim includes a Telescope extension that can be enabled using

extraConfigLuaPre = /* lua */ ''
  -- load refactoring Telescope extension
  require("telescope").load_extension("refactoring")
'';

And used in keymaps as follows:

keymps = [
  {
    mode = "n";
    key = "<leader>rr";
    action = /* lua */ ''
      function() require("telescope").extensions.refactoring.refactors() end
    '';
    lua = true;
    options.desc = "Select refactoring option";
  }
];

It'd be great if plugins.refactoring had options to configure this

Related

Perhaps plugins.telescope.enabledExtensions could be made public or an plugins.telescope.extraExtensions could be introduced to handle other unsupported telescope extensions?

@Bodleum
Copy link
Contributor

Bodleum commented Apr 5, 2024

Would it make sense to do this? You could have something like:

plugins.refactoring = {
    enable = true;
    telescopeExtension.enable = true;
};

but that wouldn't guarantee that plugins.telescope was enabled.
Of course, by enabling the extension from the refactoring side, it could also enable telescope, but I get the feeling that silently enabling other plugins is a bad idea!

Just my thoughts, push back if you disagree!

@GaetanLepage
Copy link
Member

Maybe, we should merge the telescope refactor first...

@MattSturgeon
Copy link
Member Author

Maybe, we should merge the telescope refactor first...

Agreed.

It'd be great if that pr added public access to plugins.telescope.enabledExtensions too, for any other telescope extensions we don't support.

Would it make sense to do this? You could have something like: plugins.refactoring.telescopeExtension.enable

Looks fine to me. Is this how other telescope plugins (not included in telescope itself) are handled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants