Reputation: 1930
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:
coc-go
, so I tried uninstalling it, but it didn't solve the issuego
file before and after running the update (without changing anything else), and auto-completion stopped working after the updatemod
and bin
directories in my GOPATH
, and reinstalling everything, but still, it's not working.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
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