1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vim-goでGoDef移動ができない

Posted at

概要

普通のgoファイルでは問題なくGoDefができますが、go-modのパッケージ管理を利用しているコード上だとGoDefがうまく機能しないという問題が発生しました。

具体的には、関数ジャンプGoDefを使うと、vim-go: [searching declaration] dispatchedの表示が出て、永遠とCPUの負荷が増していきました。

開発環境

  • go1.12.4 darwin/amd64
  • VIM - Vi IMproved 8.1
  • macOS Mojave 10.14.6

解決策

vim-goのプラグインに、下記の設定を追加してあげると、go-modを利用したプロジェクトでも利用可能になりました。

let g:go_def_mode = 'godef'

参考

こちらのissueが参考になりました。

GoDef unable to jump definition in other files in macOS · Issue #1687 · fatih/vim-go · GitHub

GoDef no longer works when moved to go-mod · Issue #2149 · fatih/vim-go · GitHub

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?