-
Notifications
You must be signed in to change notification settings - Fork 321
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
Inlay hints should display inferred type argument #4366
Comments
Do you mean in cases like this? foo<T>(T a) {
foo(''); // Show an inlay hint of `<String>` after `foo` so this reads foo<String>('')
} |
Hi @DanTup, thanks for fast reply, yes, that's what I meant. |
I've a change open to add this for type arguments and also list/map/set literals where it was missing before. |
Hi @DanTup, thank you for your work! On your screenshot, it infers |
The change is in the Dart analysis server in the SDK, so once the review is done and the code landed, it'll be available in main channel builds of the SDK usually within a few hours or so (and Flutter's |
…s + literals Fixes Dart-Code/Dart-Code#4366. Change-Id: I92b28869961a6098031a21ca1cf0d34f4decd16c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284143 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Landed in dart-lang/sdk@e8a8e10. |
Hi @DanTup, on your screenshot, it infers |
@Zekfad Oof, yes, I hadn't noticed that (and apparently I didn't write tests when there are both type args and parameter names at the same offset). I will fix, thanks! |
Got a fix open at https://dart-review.googlesource.com/c/sdk/+/284641. |
Fix landed in dart-lang/sdk@658e34e. |
Is your feature request related to a problem? Please describe.
It's hard to navigate to inferred type of generics. You have to lookup relevant argument and find type from it.
For now it's only possible to see inferred type from hover popup, but it's just plain text.
Describe the solution you'd like
Inlay hints should show clickable inferred types of generics.
Describe alternatives you've considered
Make hovers interactive? (But that's likely out of scope).
Additional context
Screenshot of current behavior
The text was updated successfully, but these errors were encountered: