Youcompleteme: Move to maintained version of Gocode

Created on 4 Sep 2018  路  13Comments  路  Source: ycm-core/YouCompleteMe

As mentioned in https://github.com/fatih/vim-go/issues/1932, vim-go has moved to a new version of gocode because of 1.10 and 1.11 incompatibilities, and YCM should too.

Most helpful comment

Thanks! This is working great now. Just to keep it easy, here are the steps.

Starting assumption:

  1. All you've done is install YouCompleteMe and followed the instructions for install.py --go-completer

Outcome:

  1. You do not see YouCompleteMe working for autocompletion of go files.

Fix:

  1. Change ycmd to be on master:
cd ~/.vim/bundle/YouCompleteMe/third_party/ycmd
git checkout master
git submodule update --init --recursive
  1. Repeat building the completers using the install.py script:
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer --go-completer

NOTE: Your invocation of ./install.py may differ if you are enabling other completers.

Outcome:

You should be able to open a Go file and see autocomplete working.

All 13 comments

I'll leave this up until the PR lands, then, to track and keep resubmissions down.

This has been merged into ycmd/master, closing PR

I was wrong. While this has landed in ycmd, YouCompleteMe is still broken.

@Valloric could you re-open?

We need to update the ycmd submodule.

Thanks, sorry for the churn.

What are the possible impacts of this before it is "fixed"?

I am running go 1.11, using MacVim as suggested, followed all the docs, etc and the auto-tiggers for go still don't seem to work.

A comment here mentions that that YouCompleteMe is "broken" due to this. <CTRL-Space> seems to work as does <C-x><C-o>. However, I should be able to type something like fmt. and start to see completions. That isn't happening.

Just go into YouCompleteMe/third_party/ycmd and pull the latest master if you need this fixed. With go 1.11 YCM is completely broken with an updated ycmd submodule. The <C-x><C-o> (or better said, omnifunc) is not something that YCM uses.

I'm certainly doing something wrong, or misunderstanding what's being said. Here's what I am doing:

  1. I use vundle, so I went and commented out the line adding the YouCompleteMe plugin from my .vimrc file. I then issues the :PluginClean command which deleted YCM from my system.
  2. I then uncommented the plugin line and issued :PluginInstall.
  3. I went to ~/.vim/bundle/YouCompleteMe/third_party/ycmd and did git checkout master && git pull
  4. I then went to ~/.vim/bundle/YouCompleteMe and issued ./install.py --go-completer and I get the following error:
can't load package: package github.com/mdempsky/gocode: no Go files in /Users/dnewman/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/github.com/mdempsky/gocode

Any idea as to what is up here?

Go back to YouCompleteMe/third_party/ycmd and do git submodule update --init --recursive. Then rebuild.

Thanks! This is working great now. Just to keep it easy, here are the steps.

Starting assumption:

  1. All you've done is install YouCompleteMe and followed the instructions for install.py --go-completer

Outcome:

  1. You do not see YouCompleteMe working for autocompletion of go files.

Fix:

  1. Change ycmd to be on master:
cd ~/.vim/bundle/YouCompleteMe/third_party/ycmd
git checkout master
git submodule update --init --recursive
  1. Repeat building the completers using the install.py script:
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer --go-completer

NOTE: Your invocation of ./install.py may differ if you are enabling other completers.

Outcome:

You should be able to open a Go file and see autocomplete working.

Another note: Vundle's :PluginUpdate, if I remember correctly, will try to run git submodule update --init --recursive in YouCompleteMe directory and, since ycmd is a YouCompleteMe submodule, it will be reverted to a broken commit.

Was this page helpful?
0 / 5 - 0 ratings