-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
GoTo command not work with vendor in Golang? #2985
Comments
I can reproduce the issue and the ycmd logs show this error (godef is used to jump to definition):
Running directly the command with the latest version of godef raises the same error: $ godef -i -f=main.go -o=126 < main.go
parseLocalPackage error: no more package files found
godef: no declaration found for logger.Info so it looks like an issue with godef. Would you mind reporting it to the godef repository? |
okay, thank you |
Ran into the same issue today, found out that vim-go's ycmd uses a old fork of godef which doesn't really deal with golang vendor directories. you can use vim-go's autocmd FileType go nnoremap <C-c>g :<C-u>call go#def#Jump("vsplit")<CR> |
@timfeirg Did you read my comment? I tried with the latest version of Godef. Are you sure you are talking about the same issue? |
I'm sorry, I didn't exactly carry out the steps to verify that it's fixed. I just put the example code in Also, I was seeing the upstream godef correctly finds the dependencies in the vendor directories, and just think that it's pretty convincing. @micbou |
The |
hello, after compile latest YCM with |
using language server protocol now. |
still not work, hope to be fixed |
Can I configure |
No |
We have switched to gopls which solves the issue with the GoTo subcommand. |
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
Frequently Asked Questions section.
about to report and couldn't find an answer to my problem. (Example Google
search.)
vim --version
.:YcmDebugInfo
.the
:YcmToggleLogs
command.version) I am using.
my issue, including what I expected to happen and what actually happened.
of
install.py
(orcmake
/make
/ninja
) including its invocationthat any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
actually perform all of these steps.
Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Issue Details
main.go
in gopathrun
dep ensure -add "go.uber.org/zap"
use vim, open
main.go
, jump to line 11, underInfo
oflogger.Info
, and run:YcmCompleter GoTo
,got
RuntimeError: Can't find a definition.
jump to definition of
Info
inner vendor directory.nothing but
RuntimeError: Can't find a definition.
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Contents of YCM, ycmd and completion engine logfiles
OS version, distribution, etc.
Output of build/install commands
./install.py --go-completer
The text was updated successfully, but these errors were encountered: