diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c003090aaf45d..e158cf561414e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3972,7 +3972,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) + "..."; } @@ -4043,7 +4043,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 a0a57176b0fb3..d3b0d8f571b3e 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;