Imagine this scenario with a specific type and a generic:
type Data = { item: number };
type Generic<T> = {
obj: T;
};
Now, let's create an instance of this generic:
const test: Generic<Data> = { obj: { item: 0 } };
When accessing test.obj
, wouldn't it be nice to see the type for obj (Data
) when clicked on, rather than its generic type (T
)?
Upon clicking on test.obj
https://i.sstatic.net/W6uku.png
Expected Behavior:
I expected it to navigate to the definition of Data
type
type Data = { item: number };
Actual Outcome:
Instead, it led me to the definition in the generic T
type Generic<T> = {
obj: T;
};
Do you think achieving this behavior is possible?