-
-
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
gopls functionality doesn't when GOPATH should be detected #2254
Comments
Thank you for the report @dhduvall . This may be a fairly easy fix. I'll get to it as soon as I can, but there are some caveats that might complicate some use cases. FWIW, I use https://direnv.net/ to manage these kinds of things so that even |
bhcleek
added a commit
to bhcleek/vim-go
that referenced
this issue
May 2, 2019
bhcleek
changed the title
gopls functionality doesn't work without $GOPATH set
gopls functionality doesn't when GOPATH should be detected
May 2, 2019
Does #2255 resolve this for you? |
Yes, it does; thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you do? (required. The issue will be closed when not provided.)
I have
let g:go_autodetect_gopath = 1
in my~/.vimrc
, which does a fine job of figuring out what$GOPATH
should be set to in my workspace. Then I use one of the functions that usesgopls
, such as autocomplete.The issue seems to be that the
BufEnter
autocmd
that sets$GOPATH
based on the autodetected value runs aftergopls
is launched (from theFileType
autocmd
in thevim-go
augroup
, if I'm reading this correctly). If I start vim with$GOPATH
already set correctly, everything seems to work correctly.Perhaps I need to move away from using
g:go_autodetect_gopath
, but I'm not sure what mechanism I'd use to set$GOPATH
(I don't want or need to set it generally outside vim, and it's potentially different for different workspaces).What did you expect to happen?
Get correct autocomplete results.
What happened instead?
Get back nothing.
:messages
showsConfiguration (MUST fill this out):
vim-go version:
3e9a292
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
):Go version (
go version
):1.12.4
Go environment (
go env
):The text was updated successfully, but these errors were encountered: