Farzad
Farzad

Reputation: 1930

vim-go completion stopped working after updating

I'm using neovim with coc.nvim and have been using vim-go and coc-go, and everything was working fine.

I have the habit of updating everything every couple of days, and I do that using the following commands:

:PlugUpgrade
:PlugUpdate
:GoUpdateBinaries
:CocUpdateSync

Recently after I did the update, the auto-completion for go files has stopped working.

Things I tried:

When I open a go file, I see the message vim-go: initialized gopls, but I also see the following message

[coc.nvim]: Unhandled rejection: TypeError: Cannot read property 'workspaceFolders' of undefined

I thought this message is responsible for things being broken, but that's not the case: after digging a bit on the message, that message is coming from coc-go, but even when I uninstall coc-go, my auto-completion is still not working

Upvotes: 3

Views: 2155

Answers (1)

Genjik
Genjik

Reputation: 329

This change helped me to fix the error -> https://github.com/josa42/coc-go/pull/89/commits/046eb6f8d2686b2317e15d58535435592b1eaa76

Find the extension.js file in coc's config folder. In my case, it is located in "$HOME/config/coc/extensions/node_modules/coc-go/lib" and replace these lines:

disableWorkspaceFolders: config.disable.workspaceFolders,
disableDiagnostics: config.disable.diagnostics,
disableCompletion: config.disable.completion,

with:

disableWorkspaceFolders: config.disableWorkspaceFolders,
disableDiagnostics: config.disableDiagnostics,
disableCompletion: config.disableCompletion,

Upvotes: 2

Related Questions