#How to get intellisense to display actual structure instead of named type?

9 messages · Page 1 of 1 (latest)

compact marsh
#

Often times if I have complex types that I am naming for reuse purposes and what not I have a ton of named things referring to other named things. This is nice for organizational purposes but sometimes I want to just be able to inspect a variable or type and figure out what is effectively "compiles to" instead of having to reference a thosuand differnet named variabels and keep track of it in my head.

For instance:

type FooT = { test: string } | undefined;

const foo: FooT;

If I highlight the variable foo I will get intellisense telling me it is of type FooT but I would love for a way for it to show me { test: string } | undefined instead.

plucky scroll
#

not possible

#

or at least to some extend

compact marsh
#

I don't see how its not possible. If I start using the variable, intellisense will make suggestions based on its resolved strucutre, so it does it in some way

plucky scroll
#

it's not consistent

#

and it's not really possible to control that

#

except maybe sometimes with & {}

#

I know TS toolbelt has a type to force resolve a type, so maybe have a look at how it's done