简体   繁体   中英

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:

悬停在界面上的工具提示

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

悬停在类型上的工具提示

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

创建函数的工具提示

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:

推断类型工具提示

Or this beauty VS Code gives you while typing:

键入帮助工具提示

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

添加缺少的属性工具提示 从“添加缺少的属性”中添加了属性

Thank you for your help!

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM