zbirenbaum / copilot-cmp

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

`debounce` option in `copilot.lua` doesn't seem to apply for cmp suggestions #106

Open ravibrock opened 2 months ago

ravibrock commented 2 months ago

Hi! I'm opening this issue since I was hoping for a way to ask Copilot to wait for some x amount of time before bringing up suggestions again. I've found that I often run into an issue where I'll be typing, say, function() and then I'll hit <CR> to get a newline and continue typing the function body. However, because I have <CR> mapped to cmp confirmation and Copilot typically generates a suggestion by the time I've typed func..., I end up confirming that suggestion rather than just getting a newline. My idea was an option (that ideally debounce would work for) where typing a character cancels the Copilot suggestion for the specified number of milliseconds, so that if I'm typing quickly Copilot suggestions don't appear but if I stop typing then the Copilot suggestion appears. I hope that makes sense. Thank you!