golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.87k stars 752 forks source link

Workspace with multiple Go Modules becomes slow #1389

Closed makkes closed 3 years ago

makkes commented 3 years ago

For asking questions, see:

Before filing an issue, please review our troubleshooting guides

Please answer these questions before submitting your issue. Thanks!

What version of Go, VS Code & VS Code Go extension are you using?

go env Workspace Folder (licensing): /home/max/dev/dkp/yakcl/licensing GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/max/.cache/go-build" GOENV="/home/max/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/max/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/max/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.16.2" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/max/dev/dkp/yakcl/licensing/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1321196995=/tmp/go-build -gno-record-gcc-switches"

Workspace Folder (federation): /home/max/dev/dkp/yakcl/federation GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/max/.cache/go-build" GOENV="/home/max/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/max/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/max/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.16.2" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/max/dev/dkp/yakcl/federation/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build319891848=/tmp/go-build -gno-record-gcc-switches"

Workspace Folder (test): /home/max/dev/dkp/yakcl/test GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/max/.cache/go-build" GOENV="/home/max/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/max/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/max/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.16.2" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/max/dev/dkp/yakcl/test/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2853875268=/tmp/go-build -gno-record-gcc-switches"

Workspace Folder (chart): /home/max/dev/dkp/yakcl/chart GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/max/.cache/go-build" GOENV="/home/max/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/max/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/max/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.16.2" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build198826955=/tmp/go-build -gno-record-gcc-switches"

Workspace Folder (clientapis): /home/max/dev/dkp/yakcl/clientapis GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/max/.cache/go-build" GOENV="/home/max/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/max/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/max/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.16.2" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/max/dev/dkp/yakcl/clientapis/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build226165350=/tmp/go-build -gno-record-gcc-switches"

Workspace Folder (common): /home/max/dev/dkp/yakcl/common GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/max/.cache/go-build" GOENV="/home/max/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/max/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/max/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.16.2" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/max/dev/dkp/yakcl/common/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3662601645=/tmp/go-build -gno-record-gcc-switches"


### Share the Go related settings you have added/edited

Run `Preferences: Open Settings (JSON)` command to open your settings.json file.
Share all the settings with the `go.` or `["go"]` or `gopls` prefixes.
"go.useLanguageServer": true,
"go.toolsManagement.autoUpdate": true,


### Describe the bug
Code completion and popup hints are extremely slow. When I type functions to be called I can literally see the highlighting progress. See attached GIFs for a comparison.

### Screenshots or recordings

A single module:

![vscode-single-mod](https://user-images.githubusercontent.com/387444/113267379-95464880-92d6-11eb-98cd-7ece269238da.gif)

Multi-root workspace with 5 Go Modules:

![vscodego-multi-root-mod](https://user-images.githubusercontent.com/387444/113267386-96777580-92d6-11eb-9c77-775127d1b0bc.gif)
stamblerre commented 3 years ago

Thank you for filing this report. We know that the UX of working with multiple modules isn't great right now, so we're looking at an improved workflow--experimental workspace module support. For now, I either suggest opening one module at a time or trying out this experimental mode if it fits your needs.

makkes commented 3 years ago

Thank you for filing this report. We know that the UX of working with multiple modules isn't great right now, so we're looking at an improved workflow--experimental workspace module support. For now, I either suggest opening one module at a time or trying out this experimental mode if it fits your needs.

Thank you @stamblerre for your explanation. I'll fall back to single-module for now. 👍🏻