Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: creating a new file in a package causes import errors to show and disappear as the new file is edited #36960
Please answer these questions before submitting your issue. Thanks!
What did you do?
In my project (https://github.com/hortbot/hortbot), added a new file in the
What did you expect to see?
No errors when I'm in a good state.
What did you see instead?
Every time I edit the file, I can see the other files in the package flash red and back again. There are diagnostics being sent and then removed repeatedly on edit. Sometimes, I can edit the file, and they'll persist. Looking at the logs, it appears to be errors about imports.
This change fixes an issue where import errors would not disappear when creating new files in a module by removing the segment of code where we check for listErrors when fixing imports. Updates golang/go#36960 Change-Id: Iefa17edeb0417cac7e33ffa88faf7c9a607e98b3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/219222 Run-TryBot: Rohan Challa <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Rebecca Stambler <email@example.com>
@zikaeroh I just pushed up https://go-review.googlesource.com/c/tools/+/219222 that should have fixed this issue. Can you give it a try when you get the chance?
No, the issue still appears. Note that this extends out into all packages that depend on the package with a new file.
I add a new file