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: incorrect error messages for inner module appearing in nested module #49105
Comments
Can you please share your |
I added these to settings {
"go.languageServerFlags": [
"-rpc.trace"
],
"gopls": {
"verboseOutput": true
}
} and copied log to this gist https://gist.github.com/unconsolable/b0969b8ecb4c85aee25636fd926a5290 |
Thanks for providing the logs @unconsolable. It looks like you are working with nested modules. You can see more information about setting up your editor to work with nested modules here: https://github.com/golang/tools/blob/master/gopls/doc/workspace.md#multiple-modules |
I was able to reproduce the issue using the go command, where the error is produced only in the outer module: Output when running
Output when running
|
I'm a bit confused. Tried on multiply workspace and experimental workspace module mode, all of them can not resolve the problem. After running |
This is not an issue with tidb, but an issue with gopls. We are working on improving multi-module support. I will transfer this issue to gopls to track. |
BrokenImport
CC @matloob, who is going to be looking at multi-module support in gopls. |
Change https://golang.org/cl/365737 mentions this issue: |
workspaces Go versions are not valid semver, so we were always resolving Go 1.12 in the workspace module. This matters with lazy module loading. Fixes golang/go#49668 Updates golang/go#49105 Fixes golang/go#48364 Change-Id: Iae4f5f6e17df4be1f4d6ee9d3f439efa3cf658d3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/365737 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
I believe this is fixed by CL 365737. Please reopen if I'm misunderstanding. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
When I open
github.com/pingcap/tidb
via VS Code and this extension, it wrongly report error as followsHowever, actually everything is fine, the program can be complied. Also, when I open the
parser/
directory, it will not reportBrokenImport
errors any more.Steps to reproduce the behavior:
github.com/pingcap/tidb
on local machine, install needed dependencies.tidb
via VSCode and go extension, it will report error as shown.tidb/parser
via VSCode and go extension, it will not report error any more.Screenshots or recordings
The text was updated successfully, but these errors were encountered: