Vim-go: :GoDef takes too much time for navigation.

Created on 9 Jul 2018  路  1Comment  路  Source: fatih/vim-go

What did you do? (required. The issue will be closed when not provided.)

Use :GoDef for navigation among functions.

What did you expect to happen?

When hits gd or ctrl-] or just :GoDef, it will jump to the declaration immediately, as with GoLand's "Go To Declaration" (the shortcut is CMD-B in macOS High Sierra).

What happened instead?

:GoDef takes too much time for Searching declaration ..., compared to GoLand. Seems like some Cache or Search Directory issues. Maybe the solution is just define some root searching path.

Configuration (MUST fill this out):

  • vim-go version:
    latest

  • vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):
    Latest version of https://github.com/amix/vimrc , which is popular, and embeds vim-go. A minimal vimrc is still used when testing though.

  • Vim version (first three lines from :version):
    8.0.1283

  • Go version (go version):

go version go1.10.1 darwin/amd64
  • Go environment (go env):
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/pyericz/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/pyericz/Workspace/Golang"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/70/nnmrjvv50q7gmn4d3fndb13c0000gn/T/go-build623267033=/tmp/go-build -gno-record-gcc-switches -fno-common"

Most helpful comment

I think it's guru problem. By default, :GoDef uses guru, which is very slow. When change go_def_mode to godef with following configuration, it becomes nice and smooth.

let g:go_def_mode = 'godef'

>All comments

I think it's guru problem. By default, :GoDef uses guru, which is very slow. When change go_def_mode to godef with following configuration, it becomes nice and smooth.

let g:go_def_mode = 'godef'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrejvanderzee picture andrejvanderzee  路  3Comments

smontazeran picture smontazeran  路  4Comments

preslavmihaylov picture preslavmihaylov  路  3Comments

surest picture surest  路  3Comments

cassiobotaro picture cassiobotaro  路  3Comments