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: include receiver type parameters when completing receivers #50684
Comments
Thank you! A test case to demonstrate the issue: type SyncMap[K comparable, V any] struct {}
func (s *Syn Here gopls completes to |
"A parameterized type may also have methods associated with it. In this case, the method receivers must declare the same number of type parameters as present in the parameterized type definition." from the draft language definition confirms that this is the right choice. |
Change https://golang.org/cl/380354 mentions this issue: |
thanks. i'll look at it.
…On Tue, Feb 1, 2022 at 8:51 AM rkfg ***@***.***> wrote:
I'm not sure if I do something wrong but this doesn't completely fix the
bug. I'm testing it in VS Code. Yes, it now says SyncMap[K,V] in the
popup but when I confirm this completion I only get SyncMap without type
parameters:
[image: record]
<https://user-images.githubusercontent.com/184066/151980553-8953fe3c-6dd9-4914-96e3-59955a61f4c5.gif>
—
Reply to this email directly, view it on GitHub
<#50684 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIAI5J2SEWCBUE34WAVNTUY7QM5ANCNFSM5MKI7PIQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
I misunderstood what vscode wants. The fix itself is easy, but it's bad
that our tests didn't uncover the problem.
…On Tue, Feb 1, 2022 at 8:55 AM Peter Weinberger ***@***.***> wrote:
thanks. i'll look at it.
On Tue, Feb 1, 2022 at 8:51 AM rkfg ***@***.***> wrote:
> I'm not sure if I do something wrong but this doesn't completely fix the
> bug. I'm testing it in VS Code. Yes, it now says SyncMap[K,V] in the
> popup but when I confirm this completion I only get SyncMap without type
> parameters:
> [image: record]
> <https://user-images.githubusercontent.com/184066/151980553-8953fe3c-6dd9-4914-96e3-59955a61f4c5.gif>
>
> —
> Reply to this email directly, view it on GitHub
> <#50684 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABJIAI5J2SEWCBUE34WAVNTUY7QM5ANCNFSM5MKI7PIQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you were assigned.Message ID:
> ***@***.***>
>
|
Reported in #50623 (comment): when completing generic receivers, we omit receiver type parameters. It would be helpful if we could include them, with placeholders, rather than force the user to type them every time.
The text was updated successfully, but these errors were encountered: