-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/cmd/gopls: errors reported in package with no errors #32247
Comments
Is this error message logged or shown as a diagnostic? That CL changed it so that it would not show that diagnostic message anymore. |
Sorry, I forgot to include that critical detail: it's logged. |
It comes through as an error message though; so my expectation was the user should know about it. i.e. there has been an error, something has gone wrong. |
I encounter the same error. It occurs when I freshly start vim. If I leave the file/buffer open for a while it starts working after a minute or so. I haven't found the right timing yet. I just opened the buffer switched to this tab to describe the problem, went back to verify the error and the error was gone. I tried that a few times and it seemed to solve the error. Could it be that the server needs a while to start? I found this recent change which you labeled as "fixing a race condition" and it is concerned with package scanning. If I install My setup is |
I think the other point to note, at least in my case, is that there should not be any type checking errors. The package in question compiles without error. |
Exact same issue here with latest version from master. Package compiles, but I'm getting the same error message from gopls. |
[Error - 上午9:17:45] failed to run analyses for file:///Users/elvizlai/xxxx/main.go: analysis skipped due to errors in package: [/usr/local/Cellar/go/1.12.5/libexec/src/net/lookup_unix.go:324:23: undeclared name: cgoLookupPTR /usr/local/Cellar/go/1.12.5/libexec/src/net/lookup_unix.go:124:24: undeclared name: cgoLookupCNAME /usr/local/Cellar/go/1.12.5/libexec/src/net/lookup_unix.go:108:23: undeclared name: cgoLookupPort /usr/local/Cellar/go/1.12.5/libexec/src/net/lookup_unix.go:96:24: undeclared name: cgoLookupIP /usr/local/Cellar/go/1.12.5/libexec/src/net/lookup_unix.go:81:24: undeclared name: cgoLookupHost] |
I believe that these errors are related to build tags / CGO, which is why the package compiles but still has errors. They didn't appear before because of a race condition. However, these errors are being logged, rather than published as diagnostics, so I'm wondering why they are being shown to the user? I would not expect these to be user facing errors. |
Change https://golang.org/cl/179218 mentions this issue: |
I think so too, occur only on darwin.
At least the autozimu/LanguageClient-neovim will display internal error if server side has error. This implements different to show diagnostic. Therefore user shown(maybe) |
Is this being tracked somewhere? Because there should be no errors, at least in the instance I reported here.
If an error is reported by An error of this sort suggests to me (although I'm hoping the spec is more prescriptive) "there was a problem with the language server, you should know about this" |
See |
There appears to be a lot of Mac discussion there; I'm on Linux. Is this the same issue? |
So there is a window/logMessage call and a window/showMessage call. In this case, we are just logging a message, so I would not expect it to be shown to the user. We actually log errors a lot in |
Yes, it should be the same error. Any code that depends on packages with build tags will probably cause this error. |
Updates golang/go#32247 Change-Id: Id474e62ea70676c782eb49dddebd64d7f274d2cf Reviewed-on: https://go-review.googlesource.com/c/tools/+/179218 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Ian Cottrell <[email protected]>
@myitcv |
@stamblerre
In vim behavior, vim can see echo area log. It's not wrote I/O. just on-memory. Sorry noisy. |
That most recent commit also fixed an issue I was about to report; I have an Before that commit, files which used functions exported from |
Hmm, after doing more work the issue came back. Maybe it wasn't fixed and that commit wasn't related after all; I'll try to put together a repro and file a new issue. |
Perfect, thank you, that's exactly the distinction I was looking/hoping for. @zchee - I think the However the
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Opened a file in Vim (using
govim
) that is part of a package that compiles and on which tests pass; received the following error message:This appears to have been introduced as part of https://go-review.googlesource.com/c/tools/+/178681
What did you expect to see?
No error message.
What did you see instead?
The above error message.
cc @stamblerre @ianthehat
The text was updated successfully, but these errors were encountered: