copilot-emacs / copilot.el

An unofficial Copilot plugin for Emacs.
MIT License
1.71k stars 122 forks source link

Automatically add "fix" on compile errors #318

Open beberman opened 2 weeks ago

beberman commented 2 weeks ago

My biggest issue with copilot (not the integration) is that it generates code that looks right but doesn't actually compile because the function names are wrong. It would be amazing if comments were automatically inserted into a code block that said "fix" and then showed the list of errors. I did some experiments and this additional hint can help copilot understand how to fix the code.

dov commented 1 week ago

The problem is that copilot and eglot (the emacs lsp client) don't talk to one another. So copilot "hallucinates" based on generic code, and not based on the actual symbols. One small improvement would be if the client at least filters the results so that eglot compatible suggestions are given higher priority.