Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Typescript: expand type tooltips

I've been trying for way too long to get the VSC tooltip to show me a function's parameters' properties:

Hovering over an Interface gave me nothing:

Tooltip from hovering over an Interface

Hovering over a Type worked, which was exciting and also weird because the Interface doesn't recursively expand:

Tooltip from hovering over a Type

Unfortunately, hovering over a function doesn't expand its params:

Tooltip from creating a function

Am I missing something? It'd be incredible if I could see a parameter's shape or Type doc without having to go to the function's file/d.ts, and then to the param's type file.

Example with an inferred type:

inferred type tooltip

Or this beauty VS Code gives you while typing:

typing helper tooltip

Did just discover the "Add Missing Properties" which looks amazingly helpful:

Add Missing Properties Tooltip Added Properties from "Add Missing Properties"

Thank you for your help!

like image 718
Sean Avatar asked Feb 28 '26 22:02

Sean


1 Answers

Recursive introspection is kind of a sore spot in TS. However, you can use cmd/ctrl + click on a type name to go to the place where it's defined (or view a list of references if there are multiple).

like image 95
jsejcksn Avatar answered Mar 03 '26 12:03

jsejcksn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!