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

Register setup hook in telescope extensions #3

Closed
asmodeus812 opened this issue Sep 25, 2022 · 3 comments
Closed

Register setup hook in telescope extensions #3

asmodeus812 opened this issue Sep 25, 2022 · 3 comments

Comments

@asmodeus812
Copy link

Hi, it would be great if you could add a setup hook when the extension is registered to telescope, such as this one here - https://github.com/FeiyouG/command_center.nvim/blob/main/lua/telescope/_extensions/command_center.lua#L200

@otavioschwanck
Copy link
Owner

Hi, it would be great if you could add a setup hook when the extension is registered to telescope, such as this one here - https://github.com/FeiyouG/command_center.nvim/blob/main/lua/telescope/_extensions/command_center.lua#L200

The setup is just to save the mappings, i didn't understand why to put on the telescope extension. How the user should define their mappings in this way?

A PR is welcome!

@asmodeus812
Copy link
Author

Telescope provides an internal way to call the plugin specific setup method - the telescope config has the extensions, property which contains a table / map of configs for of each extension, telescope then calls the setup hook of each loaded extension with it's config - instead of having to do it separately in another file it's all controlled by telescope, makes sense since its a telescope extension which can't really exist in isolation on its own. All telescope extensions are providing that setup hook, it is literally this one line from the link above.

@otavioschwanck
Copy link
Owner

Telescope provides an internal way to call the plugin specific setup method - the telescope config has the extensions, property which contains a table / map of configs for of each extension, telescope then calls the setup hook of each loaded extension with it's config - instead of having to do it separately in another file it's all controlled by telescope, makes sense since its a telescope extension which can't really exist in isolation on its own. All telescope extensions are providing that setup hook, it is literally this one line from the link above.

Implemented on last update! See the README to see how to do on telescope setup.

Thanks!

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

No branches or pull requests

2 participants