Uh oh!
There was an error while loading. Please reload this page.
Enhance type argument completions - #62170
Conversation
b9800de to
d5bbf02CompareAyush Verma (i-ayushh18)
commented
Aug 2, 2025
1 similar comment
Ayush Verma (i-ayushh18)
commented
Aug 2, 2025
Matt Kantor (mkantor)
commented
Aug 4, 2025
Ayush Verma (@i-ayushh18) I don't know if this is intentional, but it seems that you have a bot which is spamming a bunch of nonsense comments across many pull requests. If it is intentional, please cut it out. |
Ayush Verma (i-ayushh18)
commented
Aug 4, 2025
Sorry for the thing,a bot was responsible for that,will suspend that at latest! |
edperetokin
commented
Aug 12, 2025
I have tested this changes locally, and it works well for me. Looking forward to seeing it merged and released soon. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Previously, `getTypeArgumentConstraint` could only find constraints for type arguments of generic type instantiations. Now it additionally supports type arguments of the following expression kinds: - function calls - `new` expressions - tagged templates - JSX expressions - decorators - instantiation expressions
e8f8ef9 to
d3e5eceCompareJake Bailey (jakebailey)
commented
Sep 8, 2025
TypeScript Bot (@typescript-bot) pack this |
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Jake Bailey (jakebailey)
left a comment
There was a problem hiding this comment.
As far as I'm concerned, this seems fine to me.
Matt Kantor (mkantor)
commented
Sep 30, 2025
Thanks for reviewing/merging! |
#43526 implemented limited support for completions within type arguments, but only for type arguments of types (not values like generic function calls), and only for specific locations within the type literal (e.g. property names of object types). This pull request generalizes type argument completions such that suggestions now appear in many more scenarios, including:
f<…>())newexpressions (new Foo<…>())tag<…>`blah`)<Component<…>/>)@decorator<…> class {})f<…>)Foo<{ x: … }>)Foo<"…">)Foo<[…]>)Suggested completions are derived from the relevant type parameter's constraint.
This pull request subsumes #61758 and includes the additional enhancements mentioned in that pull request's description.
Fixes#61751.
Fixes#56299.
Fixes#52898.
Fixes#34771.