-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
TestingAn issue that has been verified to require only test changes, not just a test failure.An issue that has been verified to require only test changes, not just a test failure.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/workspaceIssues related to support for modules or multi-module workspaces.Issues related to support for modules or multi-module workspaces.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.14.7 darwin/amd64
# gopls version
golang.org/x/tools/gopls 0.4.4
golang.org/x/tools/[email protected] h1:8djGYsaZ0ByP0vaXg4T+mnyfDcHpWKSZ+tpQSGv9ahk=
VS Code version v1.47.3
vscode-go v0.16.1
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 GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/segev/Library/Caches/go-build" GOENV="/Users/segev/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/segev/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/Cellar/go/1.14.7/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.14.7/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" 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/b_/c6yh0ksn63d1yy192x2p9f4c0000gn/T/go-build425202633=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
- Create two new packages using Go modules:
mkdir foo && cd foo go mod init github.com/segevfiner/foo cd .. mkdir bar && cd bar go mod init github.com/segevfiner/bar cd ..
- Open VS Code with vscode-go installed and gopls enabled:
code foo bar - Add
replace github.com/segevfiner/bar => ../barto modulefoo's go.mod. - Add to module
fooasmain.go:package main func main() { }
- Add to module
barasbar1.go:package bar func Bar1() { }
- Try to add
foo.Bar1()tofoo'smain.go, it would work and also auto complete it. (Might need to manually add the import statement) - Add to module
barasbar2.go:package bar func Bar2() { }
- Try to add
foo.Bar2()tofoo'smain.go, it would not autocomplete and will fail to compile until you restart the language server.
What did you expect to see?
Adding new files to replaced packages should work seamlessly, auto-completing, compiling correctly, without requiring a restart of the language server.
What did you see instead?
It fails to auto-complete, compile etc. (While working correctly with go build) until you restart the language server.
Metadata
Metadata
Assignees
Labels
TestingAn issue that has been verified to require only test changes, not just a test failure.An issue that has been verified to require only test changes, not just a test failure.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/workspaceIssues related to support for modules or multi-module workspaces.Issues related to support for modules or multi-module workspaces.