go: x/tools/gopls: doesn't work on unsaved buffers in module mode
What version of Go are you using (go version)?
$ go version go version go1.12.4 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/pendragon/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/pendragon/workstation" 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="" 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/ct/5f1j4fl91mz_sdsl_3ksr5ph0000gp/T/go-build198016486=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I am a vimer and gopher. Since gocode removed the autobuild feature, I switched to lsp and coc.nvim. At first I used go-langserver, which worked fine, but it was slow and high CPU usage. I tried the functions of bingo and gopls, bingo and gopls are problematic. The problem is always there and I didn’t see it being fixed. problem with gopls problem 1 GOPATH Project: this file in $GOPATH/src/test/main.go,I can’t get any completion information when i input these。
package main
import "net/http"
func main(){
http.
}
save the file and reopen file gopls works。

problem 2 Go mod Project:
When I introduce a third party package, I can’t get any completion information.

What did you expect to see?
Completion of normal work
What did you see instead?
go -langserver. but its performance is terrible
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
@stamblerre #31542 is closed. but i dont find the problem solved. gopls also doesnt work on unsaved buffer when i import a new thirty package.