Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
4.12k stars 147 forks source link

Error detected while processing function codeium#Accept #384

Closed YHYJ closed 3 months ago

YHYJ commented 3 months ago

When i use '31dd29' commit, everything is ok. When i use latest commit, if i press TAB when codeium:

error message:

Error detected while processing function codeium#Accept:                                                                                                
line    2:                                                                                                                                                       
E121: Undefined variable: completion

This bug seriously affects the use

lasypig commented 3 months ago
function! codeium#Accept() abort
  let current_completion = s:GetCurrentCompletionItem()
  return s:CompletionInserter(current_completion, current_completion is v:null ? '' : current_completion.completion.text) 
endfunction
antkss commented 3 months ago

i caught the same issue too, i've been requesting token for many time, the status is still on but there's no code appeared image

DaitiDay commented 3 months ago

I got the same problem today. Using Tab in insert mode (to add a tab, not for completion) raises the previously mentioned error about codeium#Accept. Furthermore, I've removed Codeium and everything works fine, but now if I run the Codeium Auth after re-installing the plugin it opens the browser window with the token, but neovim freezes with no prompt to input said token. To add to what @antkss said, for me the ON status in the statusline appears in normal mode, in insert mode I get either nothing or * (this before removing the plugin), but no code suggestion too.

Edit:

  1. The Auth error was related to Alacritty (no idea why), switching to Kitty for the authentication and then back to Alacritty seems to have fixed it.
  2. The problem related to Tab and no code suggestion is still present. A temporary solution to the tab problem could be to disable the default keybinding by setting vim.g.codeium_disable_bindings = 1 and use the keymaps reported in the README.md through the setup function.
LeonardoMor commented 3 months ago

I got the same problem today. Using Tab in insert mode (to add a tab, not for completion) raises the previously mentioned error about codeium#Accept. Furthermore, I've removed Codeium and everything works fine, but now if I run the Codeium Auth after re-installing the plugin it opens the browser window with the token, but neovim freezes with no prompt to input said token. To add to what @antkss said, for me the ON status in the statusline appears in normal mode, in insert mode I get either nothing or * (this before removing the plugin), but no code suggestion too.

Edit:

  1. The Auth error was related to Alacritty (no idea why), switching to Kitty for the authentication and then back to Alacritty seems to have fixed it.
  2. The problem related to Tab and no code suggestion is still present. A temporary solution to the tab problem could be to disable the default keybinding by setting vim.g.codeium_disable_bindings = 1 and use the keymaps reported in the README.md through the setup function.

Yeah. Then whatever you bind to codeium#Accept() when pressed and there's no suggestion will error out too. I hope to fix this soon.

DaitiDay commented 3 months ago

Thanks 😄

Update 2.0: Don't know if this information is of any use, but I tested the plugin with a slightly older neovim config. The two are nearly identical (with some minor keymaps differences from what I can tell). In the "older version" codeium is working as expected. The lazy-lock.json for the working config reports:

"codeium.vim": { "branch": "main", "commit": "9406f13cf3eaa08318b76746bd105a04506cab27" },

while the same file for the broken config reports:

"codeium.vim": { "branch": "main", "commit": "35d4a8e598fb2955308d5bf69d9e9229e5483bd6" },
DaitiDay commented 3 months ago

I've updated the plugin, the Tab problem is no more (thank you 😄 ) but I still get no suggests ._.

LeonardoMor commented 3 months ago

I've updated the plugin, the Tab problem is no more (thank you 😄 ) but I still get no suggests ._.

Me neither 😅

Oddly enough, it works with Vim and not with Neovim. There might be something going on with the language server. See here