Skip to content
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

x/tools/gopls: strange output with gopls >= 0.3.0, no actual errors detected #37046

Closed
teeaa opened this issue Feb 5, 2020 · 3 comments
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@teeaa
Copy link

teeaa commented Feb 5, 2020

What did you do?

Made an error in code:

package main

func main() {
	asd asd asd() asd
}

What did you expect to see?

gopls to report the error (or rather, squiggly lines in vs code)

What did you see instead?

No errors, lots of strange logs in gpls output:

$ gopls -rpc.trace -v check go/src/foobar/cmd/daemon/main.go
2020/02/05 14:44:15 Info:2020/02/05 14:44:15 Build info
----------
golang.org/x/tools/gopls v0.3.1
    golang.org/x/tools/[email protected] h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=
    github.com/BurntSushi/[email protected] h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/[email protected] h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/[email protected] h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/[email protected] h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/[email protected] h1:hWZVyLW37WdETuLIGQMvQIhMfXXAOANmAIEAluZMy3c=
    golang.org/x/[email protected] h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/[email protected] h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
    mvdan.cc/xurls/[email protected] h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info
-------
go version go1.13.7 linux/amd64

GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/teeaa/foo/bar/go/bin"
GOCACHE="/home/teeaa/.cache/go-build"
GOENV="/home/teeaa/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/teeaa/foo/bar/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build526571037=/tmp/go-build -gno-record-gcc-switches"
2020/02/05 14:44:15 Info:2020/02/05 14:44:15 go/packages.Load
	snapshot = 0
	query = [./ builtin]
	packages = 2
2020/02/05 14:44:15 Info:2020/02/05 14:44:15 go/packages.Load
	snapshot = 1
	query = [./]
	packages = 1
2020/02/05 14:44:15 Info:2020/02/05 14:44:15 go/packages.Load
	snapshot = 0
	query = [./]
	packages = 1
2020/02/05 14:44:15 diagnose: no workspace packages: no metadata for [LOAD_INVALID_VIEW]
	snapshot = 0
	directory = 0xaf2ea0
2020/02/05 14:44:15 diagnose: no workspace packages: no metadata for [LOAD_INVALID_VIEW]
	snapshot = 1
	directory = 0xaf2ea0
2020/02/05 14:44:15 Error:2020/02/05 14:44:15 diagnose: no workspace packages: no metadata for [LOAD_INVALID_VIEW]
	snapshot = 0
	directory = 0xaf2ea0
2020/02/05 14:44:15 Error:2020/02/05 14:44:15 diagnose: no workspace packages: no metadata for [LOAD_INVALID_VIEW]
	snapshot = 1
	directory = 0xaf2ea0
/home/teeaa/foo/bar/go/src/foobar/cmd/daemon/main.go:4:6: expected ';', found asd

Build info

golang.org/x/tools/gopls v0.3.1
    golang.org/x/tools/[email protected] h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=
    github.com/BurntSushi/[email protected] h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/[email protected] h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/[email protected] h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/[email protected] h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/[email protected] h1:hWZVyLW37WdETuLIGQMvQIhMfXXAOANmAIEAluZMy3c=
    golang.org/x/[email protected] h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/[email protected] h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
    mvdan.cc/xurls/[email protected] h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.13.7 linux/amd64

GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/teeaa/foo/bar/go/bin"
GOCACHE="/home/teeaa/.cache/go-build"
GOENV="/home/teeaa/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/teeaa/foo/bar/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build187624939=/tmp/go-build -gno-record-gcc-switches"

This same error happens if I run it from "workspace" root (/home/teeaa/foo/bar) or from GOPATH root (/home/teeaa/foo/bar/go). However if I open just the "app" dir (/home/teeaa/foo/bar/go/src/foobar/cmd/daemon/) the errors appear as expected but jumping to different code points defined in packages doesn't work anymore in VS Code. If I open the src root (/home/teeaa/foo/bar/go/src) the errors in my package are displayed correctly, as well as over 1K errors in installed dependencies :( Also it takes ages to load.

On Gopls 0.2.2 everything works.

@gopherbot gopherbot added this to the Unreleased milestone Feb 5, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 5, 2020
@gopherbot
Copy link
Contributor

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.0 Feb 5, 2020
@stamblerre stamblerre changed the title x/tools/gopls: Strange output with gopls >= 0.3.0, no actual errors detected x/tools/gopls: strange output with gopls >= 0.3.0, no actual errors detected Feb 26, 2020
@stamblerre stamblerre added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 26, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.4.0, gopls/v0.5.0 Apr 2, 2020
@stamblerre
Copy link
Contributor

Hi @teeaa, I'm so sorry about the delayed response on this issue! Not sure how it slipped my notice. Are you still experiencing this issue with the latest version of gopls (v0.4.0)?

@pjweinb pjweinb added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 26, 2020
@gopherbot
Copy link
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.2 Jun 18, 2020
@golang golang locked and limited conversation to collaborators Jun 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants