Closed chew351 closed 5 years ago
This works for me. Have you updated gopls
recently?
Thanks for your reply!
I'm a fresh go programmer, I don't know how to get version of gopls, and I just git clone vim-go and GoInstallBinaries, following is the git log
commit d996b19ee77cd9c8df974510f23b0696cedf1ca1 (HEAD -> master, origin/master, origin/HEAD) Author: Dan Kortschak dan@kortschak.io Date: Thu May 9 11:10:16 2019 +0930
go/analysis/analysistest: fix word usage
Change-Id: Iec304e44375b0740b8bc594cfe6ce35637284555
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175939
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Regards chew
At 2019-05-10 01:09:55, "Billie Cleek" notifications@github.com wrote:
This works for me. Have you updated gopls recently?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
That looks like a fairly recent version of gopls. In that case, make sure your source file is below $GOPATH/src
or is part of a module.
Thank you very much for reply immediately.
move source code to $GOPATH/src, it works! and gopls can work with import relative path like import ./mypackage this can resolve issue
https://github.com/fatih/vim-go/issues/2281
Have a good night!
Regards chew
At 2019-05-10 12:15:30, "Billie Cleek" notifications@github.com wrote:
That looks like a fairly recent version of gopls. In that case, make sure your source file is below $GOPATH/src or is part of a module.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
What did you do? (required: The issue will be closed when not provided)
main.go in dire foo
package main <--- not package foo
import "fmt"
func main() { fmt. fmt.Println("vim-go")
} func main() { fmt.Println("vim-go") fmt. } ~ ~ -- INSERT --
if package name is not same to dir, <c+x><c+o> was always match nothing that vim just goto INSERT mode if change package main to package foo under dir foo <c+x><c+o> work normally
What did you expect to happen?
when package name is not same to dir name vim-go can autocomplete via <c+x><c+o>
What happened instead?
when package name is not same to dir name vim just go to INSERT mode
Configuration (MUST fill this out):
vim-go version:
root@work:~/.vim/bundle/vim-go# git log commit c4b419db6c57125e91d6f292daa664b73b155b7b (HEAD -> master, origin/master, origin/HEAD) Author: Billie Cleek bhcleek@gmail.com Date: Mon May 6 18:33:16 2019 -0700
vimrc
you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):vimrc
Vim version (first three lines from
:version
):vim8.1 on ubuntu18
Go version (
go version
):go1.12
Go environment
go env
Output: