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: panic because no snapshot assigned for files #42890
Comments
Staring at the code for a while, I believe this happens when |
This looks like the check later on text_synchronization.go:234, which I would've guessed would be addressed by this check in |
Change https://golang.org/cl/274235 mentions this issue: |
@dgallion1: Would you be able to share the workspace set-up that led to you encountering this issue? We have some guesses about how to mitigate the issue, but it would be best if we could reproduce it. A log would also be helpful: https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs. |
Added: "go.languageServerFlags": [ "-rpc.trace" ], |
Thank you for explaining the details of the workspace, but it's still difficult to reproduce the problem without a log. Would you be able to provide one if you encounter this again? (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs) In the meantime, I believe https://golang.org/cl/274235 will address the panic you encountered. |
Added: "go.languageServerFlags": [ "-rpc.trace" ] |
For every file change, we want to diagnose the resulting snapshots. However, we also want to diagnose the file in its "best possible" view (for example, for a nested module, we should use the inner module rather than the outer module). Add a bestView function that operates on a set of views, which allows us to a pick a view out of the *views affected* by a file modification, not out of *all* of the views in the session. This means that we can pick the best view, if any, for each file change and then only return the snapshots that we should diagnose, as well as the changed URIs for those snapshots. Fixes golang/go#42890 Change-Id: Iad23d5ed4832dfd857f1424a7244cf3bd8900e3b Reviewed-on: https://go-review.googlesource.com/c/tools/+/274235 Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
gopls version: v0.5.3
gopls flags: -rpc.trace
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.
NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
<OPTIONAL: ATTACH LOGS HERE>
The text was updated successfully, but these errors were encountered: