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: Error in newest VSCode: You are outside of a module and outside of $GOPATH/src #46625

Closed
jeremyharisch opened this issue Jun 7, 2021 · 2 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.

Comments

@jeremyharisch
Copy link

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

$ go version
go version go1.16.2 darwin/amd64

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

$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/I545056/Library/Caches/go-build"
GOENV="/Users/I545056/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/I545056/Go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/I545056/Go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.2/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.2"
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 x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pb/mf__09g557z52fz0b_fxz1kh0000gn/T/go-build3299511577=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I am currently developing a library that is used by another CLI application. For this, we are using Go as language and VSCode as the main IDE.
Since the latest update I am getting an error, and thus autocompletion does not work anymore. Furthermore, saving takes several seconds.

The project is located in the following directory on my Mac: ~/go/src/github.com/kyma-project/hydroform

What did you expect to see?

No Error, autocompletion, and fast saving.

What did you see instead?

The following 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.

@seankhliao seankhliao changed the title Error in newest VSCode: You are outside of a module and outside of $GOPATH/src x/tools/gopls: Error in newest VSCode: You are outside of a module and outside of $GOPATH/src Jun 7, 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 Jun 7, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jun 7, 2021
@findleyr
Copy link
Contributor

findleyr commented Jun 7, 2021

Thanks for the report.

Since the latest update I am getting an error, and thus autocompletion does not work anymore. Furthermore, saving takes several seconds.

Which directory did you open as your workspace root? (aside: we should perhaps include the workspace root in our error message...)

@findleyr findleyr added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 7, 2021
@findleyr findleyr modified the milestones: Unreleased, gopls/unplanned Jun 7, 2021
@jeremyharisch
Copy link
Author

I just found out, that the newest update does not support multi-module imports. Thus, when I open each module separately it works again 👍🏻
Will close the ticket regarding this.

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