-
-
Notifications
You must be signed in to change notification settings - Fork 76
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(pickers): Add telescope picker for codecompanion actions #250
Conversation
WIP WIP WIP WIP WIP WIP ts top level -> select WIP WIP WIP WIP
Thanks @Ajaymamtora this looks epic! I'll test this out tonight and my thinking is that perhaps this should be the default behaviour. If a user runs |
I think registering a proper extension for Telescope would be a nice touch. However, I'm not sure about cluttering the CodeCompanion command namespace with the command It might be better to avoid creating user commands tied to specific dependencies because, following that logic, we would need to implement separate commands for different pickers (e.g., fzf-lua, mini.pick, etc.). |
@S1M0N38 is Telescope best practice to still manually register the extension? |
I don't know. I was only point out some design choice about user commands. |
Sorry I've only got around to reviewing this now. I agree with @S1M0N38's point that I'd like to keep the command at just An easier way to obtain all of the actions is with: local context_utils = require("codecompanion.utils.context")
local actions = require("codecompanion.actions")
local context = context_utils.get()
actions.add_default_prompt_library(context) I notice that in CopilotChat.nvim they pass the actions to a telescope function: require("CopilotChat.integrations.telescope").pick(actions.prompt_actions({
selection = select.visual,
})) I consider that advantageous as a user doesn't need to register an extension. |
This has made me realise that I should probably refactor the whole actions and prompts anyway... |
@Ajaymamtora I'm in the process of massively refactoring the actions / prompts. Should be done tomorrow (hopefully) and I'll make sure I add Telescope support. I forgot how horrible and hacky my default pickers were...this was before I expected anyone to ever use the plugin 😂. |
Nice one thank you! Haha all good |
This should now be in |
The picker isn't exposed so my original issue is back :( |
I'm wondering if it's because I didn't register the extension. Can you check #267 ? I'll also move all the conversation over there as well. |
Description
As described here: #248 -- I would prefer the ability to configure the layout of the telescope picker, which cant be done currently. The current implementation seems to use vim.ui.select which I've overriden with Telescope using dressing.nvim.
If we create a telescope picker and export it as an extension, you can pass opts directly to the picker and configure the layout/bindings etc.
My default telescope layout takes up most of the screen, but for pickers with not many options like codecompanion actions, I want to reduce the size.
Related Issue(s)
#248
Screenshots
As you can see the layout is now as I wanted when compared to the discussion above, using:
Checklist