How to show inferred TypeScript type in WebStorm?

前端 未结 4 988
难免孤独
难免孤独 2020-12-25 09:35

In VS2012, you can hover over a typescript variable and it will show you the inferred type. Is there a similar feature in webstorm?

4条回答
  •  盖世英雄少女心
    2020-12-25 10:30

    Depending on the context, there are different ways to get type information. (Shortcuts for OS X)

    1. View > Expression Type ⌘⇧P: shows a popup
    2. Navigate > Type Declaration ⌘⇧B: navigates in the editor
    3. If 2. does not help, I do Navigate > Declaration ⌘B and then 2.
    4. View > Quick Definition ⌥Space (or ⌘Y)
    5. View > Parameter Info ⌘P: shows a popup with the declaration of a function parameter

提交回复
热议问题