Display narrowed type of properties in completionEntryDetails
#51526
Labels
Domain: Type Display
Bugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Request completions at
/**/
and select the option fororange
.Today, we show

This has to do with how we decide to display properties - we simply request the type of what
p
is narrowed to, not the type of individual properties. This is actually part of another weirder distinction, where narrowing a property doesn't also narrow the containing value's type.Recently there's been some discussion around whether we could do that; however, I am a bit skeptical here. Short of that, it would be nice to show users the actual type they're using.
This could get a little bit expensive; but narrowing in general should get cheaper. In theory, #51525 could avoid much of the work, and make the overhead here very low.
The text was updated successfully, but these errors were encountered: