monkoose / neocodeium

free AI completion plugin for neovim
MIT License
205 stars 8 forks source link

Error: Attempt to concatenate field `stderr` (a nil value) #7

Closed Pheon-Dev closed 5 months ago

Pheon-Dev commented 5 months ago

👎 Problem

When running NeoCodeium auth, it produces an error and does not allow me to paste the copied token Picture

🔢 Steps to reproduce

nvim --clean
:set rtp+=~/.local/share/nvim/lazy/neocodeium
:lua require('neocodeium').setup()
:lua vim.keymap.set('i', '', function() require('neocodeium').accept() end)

Picture_1

👍 Expected behavior

To allow me to paste the copied token

Neovim version (nvim -v)

nightly

Operating system (uname -om)

Linux x86_64

:checkhealth neocodeium

OK

Relevant log output

`NeoCodeium: log file is empty`
monkoose commented 5 months ago

Hello, thanks for reporting.

Is browser opened for you automatically?

monkoose commented 5 months ago

Can you help me with debugging?

If so, please find the location of the neocodeium in your system and add to lua/neocodeium/commands.lua at line 25:

vim.print(obj)

Save, open fresh nvim and try to auth and paste output of :mes

monkoose commented 5 months ago

Should be fixed with last commit.

Pheon-Dev commented 5 months ago

Is browser opened for you automatically?

Yes it does open the browser automagically

Pheon-Dev commented 5 months ago

Can you help me with debugging?

If so, please find the location of the neocodeium in your system and add to lua/neocodeium/commands.lua at line 25:

vim.print(obj)

Save, open fresh nvim and try to auth and paste output of :mes

after adding that line to commands.lua, I got the below message and simultaneously the browser opened Picture_2

Pheon-Dev commented 5 months ago

Should be fixed with last commit.

Thanks, it's working alright now.

monkoose commented 5 months ago

after adding that line to commands.lua

This is weird. Internally it uses :h vim.ui.open() which is returned vim.SystemCompleted type, which is a table with can be found at the end of :h vim.system()

{
  code = ...,
  signal = ...,
  stdout = ...,
  stderr = ...,
}

And for me it returns such table.

Pheon-Dev commented 5 months ago

I haven't dug deep into it but it works alright now. Just fiddling with the keybinds now to suit my workflow. I had a bit of trouble after auth but got fixed once I (re)moved ~/.codeium folder as it would not edit the config.json file to add the token[NOTE: to those who have both codeium and neocodeium]. Either way it works well now, not unless someone else encounters a similar problem then I'll chime in to help where I can. Thanks.