Pieter-Jan De Bruyne
Pieter-Jan De Bruyne

Reputation: 123

WebStorm TypeScript type visualisation not showing initial type on type hover

In WebStorm, when I use more complex typings the IDE does not show the resulting type (on hover over TransformedFruit) but just the formula used to transform another type into what we want. Initial type shows {} instead:

WebStorm example

In Visual Studio Code for example, when doing the same thing it shows the resulting type correctly:

enter image description here

I feel like I am missing something, some setting or whatever that is not set properly? How can I make Initial type show up correctly in WebStorm?

Snippet:

type Fruit =
    | {
    name: "apple";
    color: "red";
}
    | {
    name: "banana";
    color: "yellow";
}
    | {
    name: "orange";
    color: "orange";
};

type TransformedFruit = {
    [F in Fruit as F['name']]: F['name']
};

Upvotes: 6

Views: 706

Answers (1)

Abdelrahman Essawy
Abdelrahman Essawy

Reputation: 111

Press ctrl and hover over TransformedFruit.

Upvotes: 3

Related Questions