Skip to content
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

cannot find definition of code in vendor directory #81

Open
jiajunhuang opened this issue Apr 14, 2018 · 0 comments
Open

cannot find definition of code in vendor directory #81

jiajunhuang opened this issue Apr 14, 2018 · 0 comments

Comments

@jiajunhuang
Copy link

  1. create main.go in gopath
package main

import (
	"go.uber.org/zap"
)

func main() {
	logger, _ := zap.NewProduction()
	defer logger.Sync()

	logger.Info("haha")
}
  1. run dep ensure -add "go.uber.org/zap"

  2. use vim, open main.go, jump to line 11, under Info of logger.Info, and run :YcmCompleter GoTo,
    got RuntimeError: Can't find a definition.

  3. ycmd says: RuntimeError: Command godef -i -f=main.go -json -o=126 failed with code 2 and error "godef: no declaration found for logger.Info".

  4. run it in command:

$ godef -i -f=main.go -o=126 < main.go
parseLocalPackage error: no more package files found
godef: no declaration found for logger.Info

ref: ycm-core/YouCompleteMe#2985 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant