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

Different suggestions for neovim and copilot.el ? #50

Closed
jkbjh opened this issue Aug 12, 2022 · 7 comments
Closed

Different suggestions for neovim and copilot.el ? #50

jkbjh opened this issue Aug 12, 2022 · 7 comments

Comments

@jkbjh
Copy link

jkbjh commented Aug 12, 2022

Thanks for copilot.el, nice to be able to try this out in emacs.

I'm experiencing some interesting behaviour comparing completions in neovim vs. copilot.el;
with the following code in neovim I get ten different solutions while copilot.el gives me a single one.

import jax
import haiku as hk

class Auto

(Completing after "Auto")

Is this an expected behaviour?

@zerolfx
Copy link
Collaborator

zerolfx commented Aug 13, 2022

(Please update copilot.el, there is a related fix.)

Have you tried copilot-next-completion? I could get two or three solutions in this way.

How did you get those ten solutions? If it was by opening a side panel, I would say it is an unimplemented feature.

@jkbjh
Copy link
Author

jkbjh commented Aug 13, 2022

Yes, the ten solutions was with :Copilot panel in neovim.
However, I still get only one completion;
I also see

(:jsonrpc "2.0" :method "LogMessage" :params
	  (:level 1 :message "[INFO] [post-insertion] [2022-08-13T16:06:55.042Z] Could not get document for /tmp/test2.py. Maybe it was closed by the editor." :metadataStr "[INFO] [post-insertion] [2022-08-13T16:06:55.042Z]" :extra
		  ["Could not get document for /tmp/test2.py. Maybe it was closed by the editor."]))

in the *copilot events*, maybe this is related?

To update I've executed straight-pull-package for copilot, and also checked the repository in ~/.emacs.d/straight/repos/copilot.el.

Emacs version is Emacs 27.1.

@zerolfx
Copy link
Collaborator

zerolfx commented Aug 13, 2022

The side panel feature is the only missing feature compared to copilot.vim, but I have no plan to implement it.

I believe you can cycle solutions via copilot-next-completion or it will tell you only one completion is available.
Aug-13-2022 13-43-41

@zerolfx
Copy link
Collaborator

zerolfx commented Aug 13, 2022

I investigated that log before, but I found copilot.vim had similar log messages, so I think it's okay.

@jkbjh
Copy link
Author

jkbjh commented Aug 14, 2022

Sometimes there are more completions available, then copilot-next-completion works for me.
for this minimal snippet

import jax
import haiku as hk

class Autoencoder

cycling through completions in nvim gives me three variants, copilot.el only one.

For your example,

import jax
import haiku as hk

class S

both nvim and copilot.el give two completions each, but different ones.
Quite interesting.

Now I retried it with copilot.el five minutes later and I'm back to getting only one.

@zerolfx
Copy link
Collaborator

zerolfx commented Aug 14, 2022

I observed the same behavior.

You can examine the *copilot events* buffer, especially getCompletionsCycling requests and corresponding responses. I think the requests are the same, but Copilot gives different results.

@jkbjh
Copy link
Author

jkbjh commented Aug 15, 2022

Interesting, then this is probably just how copilot currently works.

@jkbjh jkbjh closed this as completed Aug 15, 2022
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

2 participants