53

ycmd第三方包golang.org/x/tools解决方案

 4 years ago
source link: https://www.tuicool.com/articles/FBZVbaR
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

vim安装YouCompleteMe插件时 , 碰到以下报错:

[gaoqilin@gqlmac /Users/gaoqilin/.vim/bundle/YouCompleteMe]$ git submodule update --init --recursive

Cloning into '/Users/gaoqilin/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/golang.org/x/tools'...

fatal: unable to access ' https://go.googlesource.com/tools/' : Failed to connect to go.googlesource.com port 443: Operation timed out

fatal: clone of ' https://go.googlesource.com/tools' into submodule path '/Users/gaoqilin/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/ golang.org/x/tools' failed

Failed to clone 'third_party/go/src/golang.org/x/tools'. Retry scheduled

Cloning into '/Users/gaoqilin/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/golang.org/x/tools'...

解决方案 :

从github下载golang.org/x/tools https://github.com/golang/tools

第一步: 先替换 .git/config 文件`

vim ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.git/config

找到 [submodule "third_party/go/src/golang.org/x/tools"] 替换为以下内容

[submodule "third_party/go/src/golang.org/x/tools"]
    active = true
    url = https://github.com/relunctance/tools.git

第二步: 替换 .gitmodules 文件

vim ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.gitmodules

找到 [submodule "third_party/go/src/golang.org/x/tools"] 替换为以下内容

[submodule "third_party/go/src/golang.org/x/tools"]
    path = third_party/go/src/golang.org/x/tools
    url = https://github.com/relunctance/tools.git
    ignore = dirty

第三步

cd ~/.vim/bundle/YouCompleteMe/third_party/ycmd
git submodule update --init --recursive

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK