zbirenbaum / copilot-cmp

Lua plugin to turn github copilot into a cmp source
MIT License
1.13k stars 41 forks source link

Support for manually requesting new suggestions #51

Closed eerii closed 1 year ago

eerii commented 1 year ago

Thank you so much for this awesome plugin, it works great and it is a really valuable addition to workflows. I would like to request some ability to add a keymap to erase the current copilot suggestion and trigger a new one. I have tried with copilot.lua options, but they don't seem to translate to this plugins' suggestions inside cmp. Right now the easiest way to do this is to change surrounding code or add a comment until it starts suggesting again.

zbirenbaum commented 1 year ago

Sorry if you receive an email, I misread the subject line and thought you emailed me this issue directly lol.

I can definitely look into this. To clarify though, you are requesting that instead of just cycling through the possibly multiple completions returned by getCompletionsCycling, a whole new request is sent instead?

eerii commented 1 year ago

No worries, I don't think I received an email.

Yes, at least the way I have it, getCompletionsCycling can only get 2 results, so it would be really helpful to reroll the results and get new ones, or at least tweak the debounce parameter, since sometimes even deleting a few characters and trying again gives the same suggestion (or no suggestion at all). A keymap that 100% triggered a new suggestion would be really appreciated.

zbirenbaum commented 1 year ago

I looked into this recently for something unrelated with copilot-rs. The lack of new suggestions is due to how the copilot lsp distributed by microsoft caches responses, making this impossible. If/when copilot-rs integration comes to copilot.lua this will become easily implemented. Until then though, I'm going to close this.