-
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: gopls fails to rename all uses of instantiated struct field #61640
Comments
Sorry, perhaps I'm missing something. Is this not a dupe of #61614? Can you try with gopls build from master?
|
Oh, you're probably right. I was thinking struct members and methods would be handled differently, but it'd make sense if they're not in this instance. Let me try out the updated build |
Using the latest build, renaming methods and finding references work, but attempting to rename a struct member with a generic type still only applies in the local scope. |
Thanks @willdhorn that sounds like the same type of bug I just fixed for references; we'll fix for v0.13.1. Thanks for all the reports! |
Change https://go.dev/cl/518897 mentions this issue: |
Change https://go.dev/cl/528401 mentions this issue: |
If no pattern matches a request, but a pattern would have matched if the request had a different method, then serve a 405 (Method Not Allowed), and populate the "Allow" header with the methods that would have succeeded. Updates #61640. Change-Id: I0ae9eb95e62c71ff7766a03043525a97099ac1bb Reviewed-on: https://go-review.googlesource.com/c/go/+/528401 Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
gopls version: v0.12.4 (go1.20.3)
gopls flags:
update flags: proxy
extension version: 0.39.1
go version: 1.20.3
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Fri, 28 Jul 2023 17:48:22 GMT
restart history:
Tue, 25 Jul 2023 20:01:41 GMT: activation (enabled: true)
Tue, 25 Jul 2023 20:08:52 GMT: config change (enabled: true)
Tue, 25 Jul 2023 20:09:30 GMT: config change (enabled: true)
Tue, 25 Jul 2023 20:09:41 GMT: config change (enabled: true)
Tue, 25 Jul 2023 20:11:07 GMT: config change (enabled: true)
Thu, 27 Jul 2023 04:08:03 GMT: manual (enabled: true)
(This was copied from an autogenerated crash report for the vscode-go repo, but it's related to two other issues that have been with gopls and not the vscode extension)
Related to both #61618 and #61614
gopls crashes when attempting to rename a method of a generic struct if, I think, that struct is instantiated anywhere with a generic composite literal. In the following example, gopls crashes if I try to rename WithName. Note that this happens on any method regardless of arguments, return type, or whether the receiver is a pointer or not.
Failed to auto-collect gopls trace: unrecognized crash pattern.
Logs manually copied with local file information removed
The text was updated successfully, but these errors were encountered: