-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Signature help stopped expanding type alias in TypeScript 5.5 #59078
Comments
I'm not sure what this issue is about. I think it might be about the signature help change because it has changed as follows: -my_func(inputs: Record<"in1" | "in2", string>): void
+my_func(inputs: Record<Inputs, string>): void This is just a display change (bisected to this diff). FWIW, object property completions work just fine in both versions. |
When you say it is just a display change do you mean this report is not precise or regarding its importance? Either way the outcome is a regression. Displaying |
There are no hard-and-fast rules for how type aliases are expanded or not in type display. It's sort of a black art as types can get arbitrarily complex (the type system is Turing complete) but generally TS tries to preserve the type aliases in display since they are often more informational than their full expansion. i.e. if you have a generic
I always find myself wanting the ability to hover/click on type aliases in signature help and/or other hover tips to drill down on them. It'd be awesome. |
I am not sure how to phrase this. Changing the behaviour of the displayed hints being tied to a language update is strange given it is not caused by an underlying language regression. If you don't have Given the PR mentioned by @Andarist (which I how no idea what it does or why it affects so many files) and @fatcerberus explanation I can say that a need for controlling the display depth by us is needed. This still remains a regression but intentional? |
It's a diff between 2 nightly versions - it refers to a couple of landed PRs, not a single one. If I'd have to make a guess this is caused by #58085
Type display was never treated as a binding contract so I don't think anybody from the TS team would call this a regression.
I don't think this is true. It sometimes is more helpful but sometimes isn't. It's contextual and the language server has freedom over the heuristics it uses to determine if any given type should be "expanded" or not. Those 2 being displayed differently is weird and inconsistent to me though: TS playground |
If you point it to Record and Inputs you get different results. It seems it is a way to indicate what to resolve: TS Playground Can this be used somehow to set what |
I think the underlying desire here is pretty well covered by #59029. |
This issue has been marked as "Not a Defect" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
π Search Terms
type inference
π Version & Regression Information
5.4.5
and5.5
β― Playground Link
TS Playground
π» Code
π Actual behavior
my_func(
does not show that the function accepts{in1, in2}
π Expected behavior
my_func(
// In TypeScript 5.4.5, this provides correct suggests{ in1, in2 }
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: