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: diagnostics not returned for dependencies #32859
Comments
@stamblerre I think this also belongs in the |
On a related note, other packages in the main module also do not have diagnostics reported until a file from that package is opened. This creates something of a continuity problem with the compiler, especially when running This can clearly be argued both ways. Is there perhaps an argument therefore for making this configurable? Despite this comment about other packages in the main module, I think dependencies' diagnostics should always be reported. |
This remains an issue as of b2a7f28. Based on discussion with @ianthehat, I think the "right" thing to do is to return diagnostics for the packages and their transitive dependencies of open files. But analysis results should only be returned for main module package files. |
That sounds like a reasonable approach to me. |
I've just done a test against 0cba7a3 with partial revert of CL 214586 applied on top, in the form of CL 215239, and this now appears to be fixed. Thanks very much @stamblerre! |
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?
Consider the following setup:
If we open
main.go
we do not get back any diagnostics for the dependency packagemod.com/p
, despite there being a compile error that prevents themain
package from compiling:If we then open
p/p.go
we do get the diagnostic with the above type check error.What did you expect to see?
The diagnostic for
p/p.go
to be returned when we openmain.go
, because it's an error in a dependency of the package to whichmain.go
belongs.What did you see instead?
As above.
cc @stamblerre @ianthehat
The text was updated successfully, but these errors were encountered: