diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6f5e6e44c19..0354e74bd7a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4010,7 +4010,7 @@ namespace ts { printer.writeNode(EmitHint.Unspecified, typeNode, /*sourceFile*/ sourceFile, writer); const result = writer.getText(); - const maxLength = noTruncation ? undefined : defaultMaximumTruncationLength * 2; + const maxLength = noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2; if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } @@ -4083,7 +4083,7 @@ namespace ts { function checkTruncationLength(context: NodeBuilderContext): boolean { if (context.truncating) return context.truncating; - return context.truncating = !(context.flags & NodeBuilderFlags.NoTruncation) && context.approximateLength > defaultMaximumTruncationLength; + return context.truncating = context.approximateLength > ((context.flags & NodeBuilderFlags.NoTruncation) ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); } function typeToTypeNodeHelper(type: Type, context: NodeBuilderContext): TypeNode { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 87e8c5734d9..3286024b9eb 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7,6 +7,7 @@ namespace ts { export const externalHelpersModuleNameText = "tslib"; export const defaultMaximumTruncationLength = 160; + export const noTruncationMaximumTruncationLength = 1_000_000; export function getDeclarationOfKind(symbol: Symbol, kind: T["kind"]): T | undefined { const declarations = symbol.declarations;