Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e2156a1

Browse filesBrowse files
authored
Add huge maximal length for noTruncation mode (microsoft#37461)
1 parent 237ea52 commit e2156a1
Copy full SHA for e2156a1

2 files changed

+3-2Lines changed: 3 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/checker.ts‎

Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,7 +4010,7 @@ namespace ts {
40104010
printer.writeNode(EmitHint.Unspecified, typeNode, /*sourceFile*/ sourceFile, writer);
40114011
const result = writer.getText();
40124012

4013-
const maxLength = noTruncation ? undefined : defaultMaximumTruncationLength * 2;
4013+
const maxLength = noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2;
40144014
if (maxLength && result && result.length >= maxLength) {
40154015
return result.substr(0, maxLength - "...".length) + "...";
40164016
}
@@ -4083,7 +4083,7 @@ namespace ts {
40834083

40844084
function checkTruncationLength(context: NodeBuilderContext): boolean {
40854085
if (context.truncating) return context.truncating;
4086-
return context.truncating = !(context.flags & NodeBuilderFlags.NoTruncation) && context.approximateLength > defaultMaximumTruncationLength;
4086+
return context.truncating = context.approximateLength > ((context.flags & NodeBuilderFlags.NoTruncation) ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);
40874087
}
40884088

40894089
function typeToTypeNodeHelper(type: Type, context: NodeBuilderContext): TypeNode {
Collapse file

‎src/compiler/utilities.ts‎

Copy file name to clipboardExpand all lines: src/compiler/utilities.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace ts {
77
export const externalHelpersModuleNameText = "tslib";
88

99
export const defaultMaximumTruncationLength = 160;
10+
export const noTruncationMaximumTruncationLength = 1_000_000;
1011

1112
export function getDeclarationOfKind<T extends Declaration>(symbol: Symbol, kind: T["kind"]): T | undefined {
1213
const declarations = symbol.declarations;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.