mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Add huge maximal length for noTruncation mode (#37461)
This commit is contained in:
parent
237ea526f9
commit
e2156a1535
@ -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 {
|
||||
|
||||
@ -7,6 +7,7 @@ namespace ts {
|
||||
export const externalHelpersModuleNameText = "tslib";
|
||||
|
||||
export const defaultMaximumTruncationLength = 160;
|
||||
export const noTruncationMaximumTruncationLength = 1_000_000;
|
||||
|
||||
export function getDeclarationOfKind<T extends Declaration>(symbol: Symbol, kind: T["kind"]): T | undefined {
|
||||
const declarations = symbol.declarations;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user