Closed daaku closed 4 years ago
@daaku Are you using the language server? Can you share your extension-related settings (go
or [go]
prefixes)?
If you enabled the language server, can you please capture the gopls logs following the instruction. I hope that shows us whether the gopls
, the go language server, detected the go.mod
file change or not.
The go related settings I have are:
"go.formatTool": "goimports",
"go.useLanguageServer": true,
I confirmed that this still happens (gopls
just got updated to 0.4.1 and the extension to 0.14.2
). I captured the log but it contains too much information for me to just share as is. I'll create a empty project and capture the logs and update later.
Thanks! It's also fine to redact information in the log if that's easier.
The trace of a new empty project where I open a file with 3 lines of code and reproduce the issue is nearly 1500 lines and 1.5MB in size. That's too much for me to go an audit to make me feel safe sharing.
Here's a set of repro steps, hopefully that's enough:
mkdir gt
cd gt
go mod init github.com/daaku/gt
touch main.go
code .
# wait for vscode to open, open main.go, don't write anything yet
# then back in the terminal
go get github.com/pkg/errors
No go to the vscode window that is open, open main.go
and type this in:
package main
import "github.com/pkg/errors"
var foo = errors.WithStack(nil)
go.mod
file in the browser sidebar.Thank you for the repro case - I was able to reproduce the issue. Let's continue the conversation in the upstream gopls
issue: https://github.com/golang/go/issues/39124.
Steps
go get
a new module dependency in a shell, confirm it was added togo.mod
..go
file in vscode, save it.go.mod
.go.mod
, see the warning disappear without making any changes.Setup
Extension Version: 0.14.1 Go Version: go1.14.2 linux/amd64 VSCode Version: 1.45.0 / d69a79b73808559a91206d73d7717ff5f798f23c