-
Notifications
You must be signed in to change notification settings - Fork 798
gopls: could not import package and variable detection in same package stopped working #996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@TheDhejavu thanks for reporting an issue. Did you open the editor from the directory where If opening from the directory doesn't fix the problem, please share the gopls trace. https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#vs-code |
@hyangah i opened the project from the root. Here is the tracer for golps
|
@TheDhejavu Thanks for the trace. Looks like
Can you try to clear the build cache ( |
@hyangah thanks, |
@TheDhejavu Glad to hear that the problem is resolved. @stamblerre I will leave this open for you to see. Is there any planned work to surface this type of errors in a different way from gopls side? Feel free to close this issue. |
I kind of had same issue.. the initial comment by @hyangah in my case was enlightening. I was generating some OpenAPI code which among the many things also placed a |
@riccardomanfrin Yeah, a typical "the-same-symptom-many-different-reasons" problem. We need a better error reporting and troubleshooting story. |
The error should've showed up in the status bar at the bottom of the screen. @TheDhejavu did you see the pop-up or was it not noticeable? |
Hi @stamblerre, I didn't notice any pop-up message. |
Thanks for following up, @TheDhejavu. It's unfortunate that an error message didn't appear, but it's difficult to test this exact scenario. I do think an error message will pop-up with the new logic in v0.6.0. I'm going to close this issue as a result. |
Uh oh!
There was an error while loading. Please reload this page.
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogopls -v version
to get version of Gopls if you are using the language server.code -v
orcode-insiders -v
to get version of VS Code or VS Code InsidersRun
go env
to get the go development environment detailsGO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ayodeji/Library/Caches/go-build"
GOENV="/Users/ayodeji/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/ayodeji/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/ayodeji/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ayodeji/go/src/github.com/workspace/simple-bank/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/yq/s2hqwwn519z_lgl7mqr_496c0000gn/T/go-build473978771=/tmp/go-build -gno-record-gcc-switches -fno-common"
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"]
orgopls
prefixes.Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.


The text was updated successfully, but these errors were encountered: