|
6 | 6 | addRange,
|
7 | 7 | addRelatedInfo,
|
8 | 8 | addSyntheticLeadingComment,
|
| 9 | + addSyntheticTrailingComment, |
9 | 10 | AliasDeclarationNode,
|
10 | 11 | AllAccessorDeclarations,
|
11 | 12 | AmbientModuleDeclaration,
|
@@ -7026,6 +7027,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
7026 | 7027 |
|
7027 | 7028 | function createTypeNodesFromResolvedType(resolvedType: ResolvedType): TypeElement[] | undefined {
|
7028 | 7029 | if (checkTruncationLength(context)) {
|
| 7030 | + if (context.flags & NodeBuilderFlags.NoTruncation) { |
| 7031 | + return []; |
| 7032 | + } |
| 7033 | + |
7029 | 7034 | return [factory.createPropertySignature(/*modifiers*/ undefined, "...", /*questionToken*/ undefined, /*type*/ undefined)];
|
7030 | 7035 | }
|
7031 | 7036 | const typeElements: TypeElement[] = [];
|
@@ -7057,7 +7062,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
7057 | 7062 | }
|
7058 | 7063 | }
|
7059 | 7064 | if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
7060 |
| - typeElements.push(factory.createPropertySignature(/*modifiers*/ undefined, `... ${properties.length - i} more ...`, /*questionToken*/ undefined, /*type*/ undefined)); |
| 7065 | + if (context.flags & NodeBuilderFlags.NoTruncation) { |
| 7066 | + const typeElement = typeElements.pop()!; |
| 7067 | + typeElements.push(addSyntheticTrailingComment(typeElement, SyntaxKind.MultiLineCommentTrivia, `... ${properties.length - i} more ...`)); |
| 7068 | + } |
| 7069 | + else { |
| 7070 | + typeElements.push(factory.createPropertySignature(/*modifiers*/ undefined, `... ${properties.length - i} more ...`, /*questionToken*/ undefined, /*type*/ undefined)); |
| 7071 | + } |
7061 | 7072 | addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
7062 | 7073 | break;
|
7063 | 7074 | }
|
|
0 commit comments