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: provide a way to suppress “failed to compile” notifications #40825
Comments
This error only pops up if Do you mind sharing your logs when you see this error? I really would not expect it to appear frequently if things are working correctly. |
I just started a different project, so this might not have the same root cause as before, but I'll just dump all instances here as they occur.
No output at all for gopls. gopls server has a bunch of entries like this:
Under problems, I see:
and
The first "problem" is bogus-- The second "problem" is bogus--it is complaining about a line that reads |
@josharian We need the full log, I'm afraid. This might be a dupe of #40578 if you have a folder with no Go code in it and |
Where should I look for the full log? GO111MODULE is unset; there is Go code present. |
https://go.googlesource.com/tools/+/refs/heads/master/gopls/doc/troubleshooting.md#capturing-logs describes how to get them. |
I created a new directory, then ran
I opened x.go and typed Logs: https://gist.github.com/josharian/e997023e436db031dba79a90249a9c9f |
I can't reproduce. Before I dig any further, it might be worth trying 1.15, which fixed a number of bugs related to partial/missing package declarations. Can you update and make sure it's first on your PATH when you start VS Code? |
Still reproduces with 1.15, exactly the same set of steps. https://gist.github.com/josharian/6021b95602f3ae70820bf20ec80147ee I noticed that this reproducer happened to be located as a GOPATH subdir. Sorry for not mentioning that earlier. I have also hit the same set of symptoms outside of GOPATH, so it didn't occur to me as relevant, but maybe there are multiple different things happening. |
I am able to reproduce this consistently in vscode.
when it's only go project in the workspace, there will not be any warning when editing go files. |
@zhaohanweng That is #40578. Please see #40578 (comment). |
OK, yes, this seems to be a GOPATH-specific bug in some mix of the go command and go/packages. @stamblerre seems to enjoy enabling this popup and then fixing go/packages edge cases, so perhaps she'll have something to say here. |
Change https://golang.org/cl/249703 mentions this issue: |
packages.Load returns bad data for an empty xtest in GOPATH mode. Updates golang/go#40825. Change-Id: Ibab8dcbeafc22a71a2a4c3be0008b728c13c4c80 Reviewed-on: https://go-review.googlesource.com/c/tools/+/249703 Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Thanks for investigating this, @heschik. This is similar to a number of bugs we've seen with empty files--all related to #39986. The go/packages fix here is likely not feasible, so I think the full resolution to this issue will have to come with #39986, which will hopefully be released as part of Go 1.16. In the meantime, I will mail a CL to disable the pop-up. |
Change https://golang.org/cl/250949 mentions this issue: |
@stamblerre I am now getting these pop-ups in another project. I just re-installed gopls at HEAD, or at least, I tried to. Should I...open a new issue? Do something else? |
What's the output of |
This warning pops up constantly for me, often several times a minute. There is no way I see to dismiss it permanently. I don't know what's wrong, and usually I don't care; I'm in the midst of typing or doing other work and it is a distraction. It always seems to recover by itself.
I'd love some way to suppress the notification, maybe a setting or a button in the notification itself. If set, maybe the "failed to compile" message, with useful detail, could go to the console instead, which is where I go looking if things aren't working as expected.
The text was updated successfully, but these errors were encountered: