-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GoDef no longer works when moved to go-mod #2149
Comments
Have you run |
Still the same issue, have my curser over struct type in method signature, go to use "GoDef" and receive:
Also here is my .vimrc with vim-go config section
|
This maybe relevant also:
I did this because go-code stopped building from package cache. Maybe this causes an issue ? |
You're using guru, then, not godef. Guru isn't aware of modules. |
hmmm, I changed my config too:
and now I get:
|
Is your cwd within the module directory? |
Not exactly, we use a monorepo so my cwd is:
While the code I'm building is in
|
@bhcleek, seems like you got it, if I CD to /docker-agent/ then it works correctly. Any nice way around this? |
Not as-is. vim-go would have to be modified to change to the directory temporarily by changing https://github.com/fatih/vim-go/blob/master/autoload/go/def.vim#L22-L28 to use |
@bhcleek think this is optimal use case? Or do you have hesitations around that change? |
I don't have any hesitation around that change; it's the right thing to do. If you want to take a crack at it, I'll gladly review the PR. Note that |
I also got this error in the eclipse IDE while using go modules in the project: "godef there must be at least one package that contains the file". |
i have switch to guru, and find guru is also fast. and the godef 's problem not sovled |
same problem here |
switched to |
What did you do? (required. The issue will be closed when not provided.)
Moved a code base from dep to go mods. Opened the code and then attempted to use GoDef on a structure to go to the definition of the struct in the same package.
What did you expect to happen?
Vim should open the buffer of the struct we are trying to get the definition for.
What happened instead?
I receive an error in the status bar:
vim-go: [searching declaration] FAIL
Configuration (MUST fill this out):
vim-go version:
master
vimrc
you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):Vim version (first three lines from
:version
):NVIM v0.3.1
Build type: Release
LuaJIT 2.0.5
Go version (
go version
):go version go1.11.4 darwin/amd64
Go environment (
go env
):GOARCH="amd64"
GOBIN="/Users/louis/git/go/bin"
GOCACHE="/Users/louis/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/louis/git/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/louis/git/paperspace/ps_dc/go.mod"
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/ld/r2llmym51mz9khb8h_3wvrcr0000gp/T/go-build775485816=/tmp/go-build -gno-record-gcc-switches -fno-common"
The text was updated successfully, but these errors were encountered: