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: error when adding a new file to a package #32602
Comments
Can you sync to the latest version of |
got same issue, the latest gopls |
Does the error go away if you save the file? |
@stamblerre if type package name ,reopen the file . its ok .i just create a isse for some other problems, please check it. |
I can reproduce it, but the problem goes away when I save the file. The problem is likely that go/packages doesn't support test overlays/variants. |
I have "... is not part of a package" on an existing project, saving does not fix it, as no Save actions happen. ➜ build-agent (master) ✗ gopls version |
It's also happening on existing files (pretty often). You need to restart gopls to make it go away (or use the vscode reload window command if you're using vscode) |
@gabstv: Can you sync to the latest version of There will still be some latency in adding a new file because |
I got the same issue within VScode and I am also on master with gopls. gopls keeps crashing now when editing a file.
|
This particular error should be fixed as of https://go-review.googlesource.com/c/tools/+/184258. Please update to master to get the fix. |
It's still happening to me and I'm on master |
@rssathe: Are you able to share the |
@stamblerre The workflow was to just add a new file in an existing package
|
The newest version fixed this, indeed (the problem with existing go files). |
Thanks for confirming. @rssathe, @Thomas2500, and anyone with similar issues - it seems like |
I am using the latest version of gopls in vscode. when create a new directory, and create a new go file in the directory, open the new go file, I type the
package hello
.I get the error:
When I reload the vscode window, the error disappear.
What version of Go are you using (
go version
)?go env
OutputWhat did you do?
The text was updated successfully, but these errors were encountered: