zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.64k stars 75 forks source link

Callback error when cycling through suggestions #154

Closed pbdeuchler closed 1 year ago

pbdeuchler commented 1 year ago
Error executing vim.schedule lua callback: ...e/pack/packer/opt/copilot.lua/lua/copilot/suggestion.lua:319: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
        [C]: in function 'ipairs'
        ...e/pack/packer/opt/copilot.lua/lua/copilot/suggestion.lua:319: in function 'get_suggestions_cycling_callback'
        ...e/pack/packer/opt/copilot.lua/lua/copilot/suggestion.lua:339: in function 'handler'
        ...w/Cellar/neovim/0.9.0/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Edit: Sorry for submitting this with no context. I get this seemingly randomly when cycling through suggestions. I'm not sure what triggers this, but it does seem to have to do with potentially cycling through suggestions when a request is in flight? The only reason I think so is because it happens more frequently when the suggestion is large, or is clearly using more context. But still pure conjecture.

pbdeuchler commented 1 year ago

Hmmmm, it might have something to do with keybinds. For some reason my Tab key stopped working when the error popped up. Got similar issues with Esc after I restarted.

MunifTanjim commented 1 year ago

What's the output of :Copilot version

pbdeuchler commented 1 year ago
Neovim 0.9.0
copilot.vim 1.8.3
copilot.lua decc8d43bcd73a288fa689690c20faf0485da217
copilot/dist/agent.js 1.73.0
Node.js 18.0.0

Still seeing really wonky behavior with keybinds, I wonder if it's due to the lazy loading of the plugin?

MunifTanjim commented 1 year ago

How are you setting up the plugin?

pbdeuchler commented 1 year ago

Sorry for not responding, and awesome to see this get fixed! Thank you!