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: VS Code + Go Extension: Debug Console output mysteriously stopped working #49537

Closed
shonji-cc opened this issue Nov 12, 2021 · 3 comments
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

@shonji-cc
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.17.3 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Big Sur 11.4, Apple M1

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/scotthonji/Library/Caches/go-build"
GOENV="/Users/scotthonji/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/scotthonji/dev/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/scotthonji/dev"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/st/149ffphn6z1frr4_7pghdsr00000gn/T/go-build4282860168=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Some time following a 'go mod tidy' + 'go get .', I launched one of my long-standing and unmodified launch.json configurations from a workspace opened on (not under, but exactly equal to) $GOPATH. I had been doing this all day long with no problems.

What did you expect to see?

A functioning Debug Console and no extension errors in the status bar.

What did you see instead?

A blank debugger console for build errors and runtime logging, and the following (bogus) error:

"Error loading workspace: You are outside of a module and outside of $GOPATH/src. If you are using modules, please open your editor to a directory in your module. If you believe this warning is incorrect, please file an issue: https://github.com/golang/go/issues/new."

Opening a child module folder, Debug Console output was restored. However, I have a number of local modules in the project and breaking up the workspace I've been using for many months into multiple workspaces just to avoid this issue will tank my efficiency.

I am blocked. I'd really appreciate a quick assist.

Not sure if the mod tidy + get had anything to do with it. All I picked up was Gin-Gonic and friends. Sifting through the diffs of the affected go.mod and go.sum, no dependencies were lost and all new dependencies were present in other modules in the same workspace. It might be a red herring. However I see no other diffs that might explain what happened.

@shonji-cc
Copy link
Author

This seems pretty relevent: #45015.

@shonji-cc shonji-cc changed the title VS Code Debug Console output mysteriously stopped working this afternoon VS Code + Go Extension: Debug Console output mysteriously stopped working this afternoon Nov 12, 2021
@shonji-cc shonji-cc changed the title VS Code + Go Extension: Debug Console output mysteriously stopped working this afternoon VS Code + Go Extension: Debug Console output mysteriously stopped working Nov 12, 2021
@seankhliao seankhliao changed the title VS Code + Go Extension: Debug Console output mysteriously stopped working x/tools/gopls: VS Code + Go Extension: Debug Console output mysteriously stopped working Nov 16, 2021
@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 Nov 16, 2021
@gopherbot gopherbot added this to the Unreleased milestone Nov 16, 2021
@findleyr
Copy link
Contributor

A blank debugger console for build errors and runtime logging, and the following (bogus) error:

In what way is the error bogus? Are you in $GOPATH/src, or $GOPATH? If the latter, the error message is saying to open $GOPATH/src.

Gopls has experimental multi-module support which you can enable via the experimentalWorkspaceModule setting. This still has bugs, but may help you in the short term. Set it to true and open up a parent directory of the modules you want to work on. (I think you need to be outside of GOPATH though).

Longer term (~months) we will be integrating support for the new go.work workspace files.

@findleyr findleyr added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 17, 2021
@gopherbot
Copy link

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.)

@golang golang locked and limited conversation to collaborators Dec 17, 2022
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

3 participants