zbirenbaum / copilot.lua

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

Fix E565 when using Tab as accept #284

Open stephenprater opened 2 months ago

stephenprater commented 2 months ago

As described in issue #278 - when you are set up in like SuperTab, you get this error (E565) from the LSP util that you're not allowed to modify the buffer.

The TL;DR here (I think) is that you're trying to do a synchronous accept with the results from an asynchronous call. The solution is to enqueue the accept on the event loop so that the text edit happens on the next tick (after whatever already enqueued async calls have already happened) rather than trying to do it on the "main thread"