-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: nil pointer on rename #32974
Comments
@mykter Are both the use and the type definition in the same package? Could you also post the line declaring the package level type and a variable definition? Thanks! |
Do you have any test files? If so, https://go-review.googlesource.com/c/tools/+/185277 should fix it. The following produces a similar trace: Rename x
hello_test.go
error:
|
I do have tests for that package, yes - looks like you've found it! |
Change https://golang.org/cl/185277 mentions this issue: |
Support renaming of identifiers in test packages. The packages for all of the references must be checked and the changes need to be deduped, since both a package and its test package contain some of the same files. Fixes golang/go#32974 Change-Id: Ie51e19716faae77ce7e5254eeb3956faa42c2a09 Reviewed-on: https://go-review.googlesource.com/c/tools/+/185277 Run-TryBot: Suzy Mueller <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Of gopls, yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tried to rename a type defined at package level
What did you expect to see?
The type and all references to it be renamed
What did you see instead?
No changes, and a crash:
Unfortunately the code isn't public and I don't have a minimal reproducer. I did do a quick test of adding a new package level type and variable definition, that weren't used anywhere else, and got the same result for each of them - the stack trace ends on the same line.
If this isn't enough info to diagnose, feel free to close it. I'm sure someone else will hit this at some point with an open source project!
The text was updated successfully, but these errors were encountered: