Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter answers by copilot and give higher priority to suggestions that syntax-compliant #342

Open
dov opened this issue Sep 23, 2024 · 0 comments

Comments

@dov
Copy link

dov commented Sep 23, 2024

Currently copilot is not syntax aware, and is therefore "hallucinating" the list of suggestions based on its generic "knowledge". However, in emacs it would be possible to filter the list of suggestions, and give higher priority to an answer that is valid according to eglot.

Here is an example in C++:

try {
   Foo();
} catch(const MyException& e)
{
    print("Got error: {}\n", e.GetErr());
}

Let's say that copilot completes the rest of the code as soon as you write "catch". But copilot has no way of knowing whether MyException has a method GetErr(), GetError() , GetErrorMessage(), etc. But eglot, through LSP, does know that. So in case that the syntax-compliant completion was generated as one of the suggestions by copilot, a filter by eglot, would be able to select the correct suggestion.

Of course, a deeper integration would be even better, but a simple filter would be a good start.

@dov dov changed the title Filter answers by copilot and give higher priority to suggestions that are compatible with eglot Filter answers by copilot and give higher priority to suggestions that syntax-compliant Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant