10

I have a large type like this one:

type Large = {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
} | {
    foo: 123,
    bar: 123,
    baz: 123
}

And this is how it gets shortened in VSCode when hovered:

enter image description here

How do I view the hidden part? Any suggestions would be appreciated.

P.S. Of course the type I am trying to view is not that simple and it's not statically written as well.

1 Answer 1

18

There is a seemingly unrelated compiler setting called noErrorTruncation. It controls if types are truncated in errors. If you set this compiler option to true it will also prevent type truncation in tooltips.

Note This will prevent truncation of types (the ... part) it will not unfortunately force the expansion of mapped or conditional types.

Sign up to request clarification or add additional context in comments.

1 Comment

I have the feeling there is still a limit around 1600 characters. Tried on a few very long objects, and each time there's an ellipsis at the end, the text is truncated between 1600 and 1700 characters.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.