How do I view large typescript types in VSCode?

前端 未结 1 1626
说谎
说谎 2021-01-18 06:29

I have a large type like this one:

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


        
相关标签:
1条回答
  • 2021-01-18 06:36

    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.

    0 讨论(0)
提交回复
热议问题