Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
644 stars 50 forks source link

bug: Codeium Profile Completions/Total Completions not updated after completion accepted #124

Closed cleong14 closed 6 months ago

cleong14 commented 7 months ago

Tested and confirmed only codeium.nvim fails to update completions count; codeium.vim updates completions count as expected.

milanglacier commented 6 months ago

I can confirm with this. In the personal homepage, I see that the number of accepted completions from Neovim will not increase.

pqn commented 6 months ago

This will require implementing calling the AcceptCompletion RPC in the extension. This is where it's called in other extensions for example:

cleong14 commented 6 months ago

@pqn thank you for the additional context!

If I have time, I'll try take a stab at this feature and I'll see if I can figure it out.

milanglacier commented 6 months ago

@pqn thank you for the additional context!

If I have time, I'll try take a stab at this feature and I'll see if I can figure it out.

This is a proprietary software and it is their responsibility to polish the software delivered to their user.

milanglacier commented 6 months ago

This will require implementing calling the AcceptCompletion RPC in the extension. This is where it's called in other extensions for example:

cmp has a hook cmp.event:on("confirmation_done") which can be used to send the AcceptCompletion request.

fortenforge commented 6 months ago

This is a proprietary software and it is their responsibility to polish the software delivered to their user.

We at Codeium were not the original authors of this plugin. We simply took it over when the original maintainer and author archived it.

cleong14 commented 6 months ago

This is a proprietary software and it is their responsibility to polish the software delivered to their user.

We at Codeium were not the original authors of this plugin. We simply took it over when the original maintainer and author archived it.

Additionally, per the LICENSE and the Contributing section of the README, Issues & PRs are accepted.

milanglacier commented 6 months ago

132 should solve this.

cleong14 commented 6 months ago

@milanglacier when you tested your changes, were you able to validate that your profile updated correctly each time you accepted a completion item?

milanglacier commented 6 months ago

@milanglacier when you tested your changes, were you able to validate that your profile updated correctly each time you accepted a completion item?

Of course They did update.

cleong14 commented 6 months ago

Awesome.

Maybe it was an anomaly or some discrepancy in my config at the time, but when I tested your changes my profile still only received intermittent updates on completion acceptance.

Glad to hear it works though; thanks for creating the fix & PR!

milanglacier commented 6 months ago

Awesome.

Maybe it was an anomaly or some discrepancy in my config at the time, but when I tested your changes my profile still only received intermittent updates on completion acceptance.

Glad to hear it works though; thanks for creating the fix & PR!

I use the tab key which is mapped to cmp.mapping.confirm { select = true },. I believe cmp.confirm function must be called so that the hook will be triggered and the AcceptCompletion request will send.

cleong14 commented 6 months ago

Awesome. Maybe it was an anomaly or some discrepancy in my config at the time, but when I tested your changes my profile still only received intermittent updates on completion acceptance. Glad to hear it works though; thanks for creating the fix & PR!

I use the tab key which is mapped to cmp.mapping.confirm { select = true },. I believe cmp.confirm function must be called so that the hook will be triggered and the AcceptCompletion request will send.

The issue was definitely my nvim-cmp config.

The keymap I use to accept/confirm completions was configured to cmp.mapping.confirm { select = false }. I think I recall doing this due to confirmed completions overwriting existing text if the completion was accepted in the middle of a line of text.

Changing my config to use cmp.mapping.confirm { select = true } when accepting a completion fixed the issue for me and my profile appears to be updating correctly for every completion accepted.

Thanks again for your help with the fix @milanglacier!

cleong14 commented 6 months ago

fixed in #132