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: The code in the workspace failed to compile #42268

Closed
ghost opened this issue Oct 29, 2020 · 3 comments
Closed

x/tools/gopls: The code in the workspace failed to compile #42268

ghost opened this issue Oct 29, 2020 · 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.
Milestone

Comments

@ghost
Copy link

ghost commented Oct 29, 2020

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

$ go version
go 1.15

Does this issue reproduce with the latest release?

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

go version go1.15.3 windows/amd64

image

go env Output
$ go env

What did you do?

image

When I write code, I want a code tip,
If I hit any keypad, vscode would prompt a message in the lower right corner, which is quite annoying
Then I found a way, set "go.useLanguageServer": false, This is not the case at this point
However, code prompts are slow at this point, very very slow.

When I changed it "go.useLanguageServer": true, again, The code indicates that the speed is normal and fast,
But, Here's another tip vscode the lower right,Quite annoying

What did you expect to see?

image

I don't want to see this hint, No problem running the program

What did you see instead?

@ianlancetaylor
Copy link
Contributor

Please cut and paste text as text in the issue report. Please do not attach images of text. Ordinary text is much easier to read than images. Thanks.

@LinSimmons-bitzh
Copy link

The code in the workspace failed to compile (see the error message below).
If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new.
go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- ./]: exit status 1: go: cannot find main module; see 'go help modules'
: packages.Load error

@ALTree ALTree changed the title The code in the workspace failed to compile (see the error message below). If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new. go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- ./]: exit status 1: go: cannot find main module; see 'go help modules' : packages.Load error x/tools/gopls: The code in the workspace failed to compile Oct 29, 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 Oct 29, 2020
@gopherbot gopherbot added this to the Unreleased milestone Oct 29, 2020
@heschi
Copy link
Contributor

heschi commented Oct 29, 2020

To work on a Go project, you need to open the folder of that project as the main VS Code folder. See https://github.com/golang/tools/blob/master/gopls/doc/user.md#the-set-of-workspace-folders. In your case you need to open the hello directory.

@heschi heschi closed this as completed Oct 29, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.3 Oct 29, 2020
@golang golang locked and limited conversation to collaborators Oct 29, 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.
Projects
None yet
Development

No branches or pull requests

5 participants