-
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/gopls: imports.Resolver is *imports.gopathResolver, not *imports.ModuleResolver #37108
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
Very strange. I could fix the crash very easily, but you'd be left with broken autocomplete. The problem is that the goimports code used for autocomplete thinks you're in GOPATH mode. I'm not sure why. A couple questions:
Can you show us those too? |
Thanks for quick followup!
GOPATH is set in my .bashrc, remnant from non-module projects. When I unset GOPATH before launching
|
Still very strange. There should be more than one call to Now that I'm looking at it, swallowing the error is a bad idea. I'll look at fixing that next week. If you'd like, figuring out what's going wrong with it will get this resolved more quickly. |
I see no non-json Am happy to dig further. Any ideas how I should replicate this panic outside of vscode?
|
Got it. I replaced gopls with a wrapper to debug:
Turns out, gopls first runs
It fails because it is not correctly quoted. For reference, this works fine:
In my vscode settings, I have:
I don't know why it worked with v0.2.2, perhaps previously GOFLAGS wasn't passed to Observations:
My problem is now solved, because I have eliminated the GOFLAGS entirely from my vscode setup. Thanks @heschik for your help in resolving this! |
Thanks, that makes sense. Glad it's working for you for the moment, I'll look into where the quoting problem is and fix it when I have a chance. |
Change https://golang.org/cl/218857 mentions this issue: |
Change https://golang.org/cl/219124 mentions this issue: |
This change adds a buildFlags variable to the processEnv struct rather than appending them to the GOFLAGS by using a space separator. Fixes golang/go#37108 Change-Id: I4331066c30fa51f0133504d723132527b00ce74a Reviewed-on: https://go-review.googlesource.com/c/tools/+/218857 Reviewed-by: Heschi Kreinick <[email protected]> Run-TryBot: Heschi Kreinick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit 3868802) Reviewed-on: https://go-review.googlesource.com/c/tools/+/219124
What did you do?
After vscode (1.41.1-1576681836 @ Ubuntu 16.04) upgraded gopls from v0.2.2 to v0.3.1, it crashes on start.
I could not isolate it to specific code. Gopls only crashes inside vscode. My project (some 66 .go files, using go-yara C interface) does not produce a crash when I run
I have downgraded to v0.2.2 for now.
What did you expect to see?
No crash
What did you see instead?
vscode reports gopls output:
Build info
Go info
The text was updated successfully, but these errors were encountered: