monkoose / neocodeium

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

Doesn't work in .go files #5

Closed octaviusz closed 6 months ago

octaviusz commented 6 months ago

Doesn't work in files with .go filetype, but at the same time works perfectly well and produces golang code in files with .mod.

monkoose commented 6 months ago

This isn't descriptive enough and not reproducible. At least provide some context. Does :checkhealth neocodeium shows any errors? Anything in :NeoCodeium open_log?

octaviusz commented 6 months ago

oh never mind it was my config problem with "tpope/vim-sleuth" plugin

Kypert commented 2 weeks ago

@octaviusz, thanks, it seems you are right, but I do not understand why it is conflicting. Did you solve running them side-by-side or just ripped vim-sleuth out?

octaviusz commented 2 weeks ago

@Kypert I disabled tpope/vim-sleuth

monkoose commented 2 weeks ago

I guess this is because vim-sleuth changes 'fileencoding' and codeium server accepts only utf-8 and latin1 encodings, so it is disabled otherwise. Could you check what 'fileencoding' option is after vim-sleuth changes it in go filetypes?

Kypert commented 2 weeks ago

With tpope/vim-sleuth, it looks like the .go-file stays with fileencoding=utf-8, NeoCodeium is also happy:

:lua print(require("neocodeium").get_status())
0 0

Also checked fileencodings=ucs-bom,utf-8,default,latin1, it also stays the same.

Setting vim.g.sleuth_heuristics = 0 is also a way to get NeoCodeium to work. But the heuristics is what I want :)

It seems to be related to shiftwidth:

But I fail to see why that is. Should that be added as another error-status or should it work, @monkoose?

monkoose commented 2 weeks ago

shiftwidth shouldn't disable codeium. So it is definitely a bug. I have checked it manually and in any buffer where shiftwidth is set to 0 there are no suggestions.

monkoose commented 2 weeks ago

Should be fixed with the last commit. @Kypert thanks for the investigation.

Kypert commented 2 weeks ago

Should be fixed with the last commit. @Kypert thanks for the investigation.

Right back at you, thanks for the fix! Verified v1.7.0, I can run with tpope/vim-sleuth and get suggestions in my *.go files :D