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
hlbbt opened this issue Oct 29, 2020 · 3 comments
Closed

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

hlbbt opened this issue Oct 29, 2020 · 3 comments
Labels
Milestone

Comments

@hlbbt
Copy link

@hlbbt hlbbt 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

@ianlancetaylor ianlancetaylor commented Oct 29, 2020

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

@LinSimmons-bitzh LinSimmons-bitzh commented Oct 29, 2020

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 this to the Unreleased milestone Oct 29, 2020
@heschik
Copy link
Contributor

@heschik heschik 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.

@heschik heschik closed this Oct 29, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.3 Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants