From fc51e4574b032167f6a58524bf059d516c83b4f1 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 8 Jul 2015 10:38:24 -0700 Subject: [PATCH] Automatic line wrapping in factory.generated.ts --- scripts/processTypes.ts | 121 ++++++++-------------- src/compiler/factory.generated.ts | 167 +++++++++++++++--------------- 2 files changed, 126 insertions(+), 162 deletions(-) diff --git a/scripts/processTypes.ts b/scripts/processTypes.ts index 605911c7005..ec64a6c2a62 100644 --- a/scripts/processTypes.ts +++ b/scripts/processTypes.ts @@ -785,7 +785,7 @@ function discover() { } function generate(outputFile: string) { - writer = createTextWriter(host.getNewLine()); + writer = createLineWrappingTextWriter(host.getNewLine(), columnWrap); writer.write(`// `); writer.writeLine(); writer.write(`/// `); @@ -826,46 +826,26 @@ function writeIsNodeFunctions() { function writeCreateFunction(syntaxNode: SyntaxNode) { writer.write(`export function create${syntaxNode.kindText}(`); - let indented = false; - for (let i = 0; i < syntaxNode.members.length; ++i) { - if (i > 0) { + let first = true; + for (let member of syntaxNode.members) { + if (!first) { writer.write(`, `); } - - let member = syntaxNode.members[i]; - let paramText = - member.isNodeArray ? `${member.param}?: Array<${member.elementType}>` : - member.isModifiersArray ? `${member.param}?: Array` : - `${member.param}?: ${member.type}`; - - if (writer.getColumn() >= columnWrap - paramText.length) { - writer.writeLine(); - if (!indented) { - indented = true; - writer.increaseIndent(); - } + else { + first = false; } + + let type = + member.isNodeArray ? `Array<${member.elementType}>` : + member.isModifiersArray ? `Array` : + member.type; - writer.write(paramText); + writer.write(`${member.param}?: ${type}`); } - let returnTypeText = `): ${syntaxNode.typeName} {`; - - if (writer.getColumn() >= columnWrap - returnTypeText.length) { - writer.writeLine(); - if (!indented) { - indented = true; - writer.increaseIndent(); - } - } - - writer.write(returnTypeText); + writer.write(`): ${syntaxNode.typeName} {`); writer.writeLine(); - if (indented) { - writer.decreaseIndent(); - indented = false; - } - + writer.increaseIndent(); if (syntaxNode.members.length) { writer.write(`let node = createNode<${syntaxNode.typeName}>(SyntaxKind.${syntaxNode.kindText});`); @@ -927,46 +907,22 @@ function writeUpdateFunction(syntaxNode: SyntaxNode) { writer.write(`export function update${syntaxNode.kindText}(node: ${syntaxNode.typeName}`); - let indented = false; for (let i = 0; i < syntaxNode.members.length; ++i) { let member = syntaxNode.members[i]; if (member.isFactoryParam) { continue; } - writer.write(`, `); + let type = + member.isNodeArray ? `Array<${member.elementType}>` : + member.isModifiersArray ? `Array` : + member.type; - let paramText = - member.isNodeArray ? `${member.param}: Array<${member.elementType}>` : - member.isModifiersArray ? `${member.param}: Array` : - `${member.param}: ${member.type}`; - - if (writer.getColumn() >= columnWrap - paramText.length) { - writer.writeLine(); - if (!indented) { - indented = true; - writer.increaseIndent(); - } - } - - writer.write(paramText); + writer.write(`, ${member.param}: ${type}`); } - let returnTypeText = `): ${syntaxNode.typeName} {`; - if (writer.getColumn() >= columnWrap - returnTypeText.length) { - writer.writeLine(); - if (!indented) { - indented = true; - writer.increaseIndent(); - } - } - - writer.write(returnTypeText); + writer.write(`): ${syntaxNode.typeName} {`); writer.writeLine(); - if (indented) { - writer.decreaseIndent(); - indented = false; - } writer.increaseIndent(); @@ -984,25 +940,11 @@ function writeUpdateFunction(syntaxNode: SyntaxNode) { writer.write(` || `); } - let conditionText = `${member.param} !== node.${member.property}`; - if (writer.getColumn() >= columnWrap - conditionText.length) { - writer.writeLine(); - if (!indented) { - indented = true; - writer.increaseIndent(); - } - } - - writer.write(conditionText); + writer.write(`${member.param} !== node.${member.property}`); } writer.write(`) {`); writer.writeLine(); - if (indented) { - writer.decreaseIndent(); - indented = false; - } - writer.increaseIndent(); writer.write(`let newNode = create${syntaxNode.kindText}(`); @@ -1109,4 +1051,25 @@ function getCompilerOptions() { options.noResolve = true; options.noLib = true; return options; +} + +function createLineWrappingTextWriter(newLine: string, maxWidth: number): EmitTextWriter { + let writer = createTextWriter(newLine); + let noWrap = false; + let baseWrite = writer.write; + writer.write = writeWrap; + return writer; + + function writeWrap(text: string) { + let textTrimRight = text.replace(/\s+$/, ''); + if (writer.getColumn() + textTrimRight.length > maxWidth) { + writer.writeLine(); + writer.increaseIndent(); + baseWrite(text.replace(/^\s+/, '')); + writer.decreaseIndent(); + } + else { + baseWrite(text); + } + } } \ No newline at end of file diff --git a/src/compiler/factory.generated.ts b/src/compiler/factory.generated.ts index d1b23fcbe7b..0be62934883 100644 --- a/src/compiler/factory.generated.ts +++ b/src/compiler/factory.generated.ts @@ -104,8 +104,8 @@ namespace ts { } return node; } - export function updateParameter(node: ParameterDeclaration, decorators: Array, modifiers: Array, - name: Identifier | BindingPattern, type: TypeNode, initializer: Expression): ParameterDeclaration { + export function updateParameter(node: ParameterDeclaration, decorators: Array, modifiers: Array + , name: Identifier | BindingPattern, type: TypeNode, initializer: Expression): ParameterDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || type !== node.type || initializer !== node.initializer) { let newNode = createParameter(decorators, modifiers, node.dotDotDotToken, name, node.questionToken, type, initializer); @@ -137,8 +137,8 @@ namespace ts { } return node; } - export function updatePropertySignature(node: PropertySignature, decorators: Array, modifiers: Array, name: DeclarationName, - type: TypeNode): PropertySignature { + export function updatePropertySignature(node: PropertySignature, decorators: Array, modifiers: Array, name: DeclarationName + , type: TypeNode): PropertySignature { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || type !== node.type) { let newNode = createPropertySignature(decorators, modifiers, name, node.questionToken, type); return updateFrom(node, newNode); @@ -158,8 +158,8 @@ namespace ts { } return node; } - export function updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array, modifiers: Array, - name: DeclarationName, type: TypeNode, initializer: Expression): PropertyDeclaration { + export function updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array, modifiers: Array + , name: DeclarationName, type: TypeNode, initializer: Expression): PropertyDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || type !== node.type || initializer !== node.initializer) { let newNode = createPropertyDeclaration(decorators, modifiers, name, node.questionToken, type, initializer); @@ -181,8 +181,8 @@ namespace ts { } return node; } - export function updateMethodSignature(node: MethodSignature, decorators: Array, modifiers: Array, name: DeclarationName, - typeParameters: Array, parameters: Array, type: TypeNode): MethodSignature { + export function updateMethodSignature(node: MethodSignature, decorators: Array, modifiers: Array, name: DeclarationName + , typeParameters: Array, parameters: Array, type: TypeNode): MethodSignature { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type) { let newNode = createMethodSignature(decorators, modifiers, name, node.questionToken, typeParameters, parameters, type); @@ -205,8 +205,8 @@ namespace ts { } return node; } - export function updateMethodDeclaration(node: MethodDeclaration, decorators: Array, modifiers: Array, name: DeclarationName, - typeParameters: Array, parameters: Array, type: TypeNode, body: Block + export function updateMethodDeclaration(node: MethodDeclaration, decorators: Array, modifiers: Array, name: DeclarationName + , typeParameters: Array, parameters: Array, type: TypeNode, body: Block ): MethodDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type || body !== node.body) { @@ -227,8 +227,8 @@ namespace ts { } return node; } - export function updateConstructor(node: ConstructorDeclaration, decorators: Array, modifiers: Array, - parameters: Array, type: TypeNode, body: Block): ConstructorDeclaration { + export function updateConstructor(node: ConstructorDeclaration, decorators: Array, modifiers: Array + , parameters: Array, type: TypeNode, body: Block): ConstructorDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || parameters !== node.parameters || type !== node.type || body !== node.body) { let newNode = createConstructor(decorators, modifiers, parameters, type, body); @@ -249,8 +249,8 @@ namespace ts { } return node; } - export function updateGetAccessor(node: GetAccessorDeclaration, decorators: Array, modifiers: Array, name: DeclarationName, - parameters: Array, type: TypeNode, body: Block): GetAccessorDeclaration { + export function updateGetAccessor(node: GetAccessorDeclaration, decorators: Array, modifiers: Array, name: DeclarationName + , parameters: Array, type: TypeNode, body: Block): GetAccessorDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || parameters !== node.parameters || type !== node.type || body !== node.body) { let newNode = createGetAccessor(decorators, modifiers, name, parameters, type, body); @@ -271,8 +271,8 @@ namespace ts { } return node; } - export function updateSetAccessor(node: SetAccessorDeclaration, decorators: Array, modifiers: Array, name: DeclarationName, - parameters: Array, type: TypeNode, body: Block): SetAccessorDeclaration { + export function updateSetAccessor(node: SetAccessorDeclaration, decorators: Array, modifiers: Array, name: DeclarationName + , parameters: Array, type: TypeNode, body: Block): SetAccessorDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || parameters !== node.parameters || type !== node.type || body !== node.body) { let newNode = createSetAccessor(decorators, modifiers, name, parameters, type, body); @@ -290,8 +290,8 @@ namespace ts { } return node; } - export function updateCallSignature(node: CallSignatureDeclaration, typeParameters: Array, - parameters: Array, type: TypeNode): CallSignatureDeclaration { + export function updateCallSignature(node: CallSignatureDeclaration, typeParameters: Array + , parameters: Array, type: TypeNode): CallSignatureDeclaration { if (typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type) { let newNode = createCallSignature(typeParameters, parameters, type); return updateFrom(node, newNode); @@ -308,8 +308,8 @@ namespace ts { } return node; } - export function updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: Array, - parameters: Array, type: TypeNode): ConstructSignatureDeclaration { + export function updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: Array + , parameters: Array, type: TypeNode): ConstructSignatureDeclaration { if (typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type) { let newNode = createConstructSignature(typeParameters, parameters, type); return updateFrom(node, newNode); @@ -327,8 +327,8 @@ namespace ts { } return node; } - export function updateIndexSignature(node: IndexSignatureDeclaration, decorators: Array, modifiers: Array, - parameters: Array, type: TypeNode): IndexSignatureDeclaration { + export function updateIndexSignature(node: IndexSignatureDeclaration, decorators: Array, modifiers: Array + , parameters: Array, type: TypeNode): IndexSignatureDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || parameters !== node.parameters || type !== node.type) { let newNode = createIndexSignature(decorators, modifiers, parameters, type); return updateFrom(node, newNode); @@ -375,8 +375,8 @@ namespace ts { } return node; } - export function updateFunctionType(node: FunctionTypeNode, typeParameters: Array, - parameters: Array, type: TypeNode): FunctionTypeNode { + export function updateFunctionType(node: FunctionTypeNode, typeParameters: Array + , parameters: Array, type: TypeNode): FunctionTypeNode { if (typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type) { let newNode = createFunctionType(typeParameters, parameters, type); return updateFrom(node, newNode); @@ -393,8 +393,8 @@ namespace ts { } return node; } - export function updateConstructorType(node: ConstructorTypeNode, typeParameters: Array, - parameters: Array, type: TypeNode): ConstructorTypeNode { + export function updateConstructorType(node: ConstructorTypeNode, typeParameters: Array + , parameters: Array, type: TypeNode): ConstructorTypeNode { if (typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type) { let newNode = createConstructorType(typeParameters, parameters, type); return updateFrom(node, newNode); @@ -509,8 +509,8 @@ namespace ts { } return node; } - export function createBindingElement(decorators?: Array, modifiers?: Array, propertyName?: Identifier, - dotDotDotToken?: Node, name?: Identifier | BindingPattern, initializer?: Expression): BindingElement { + export function createBindingElement(decorators?: Array, modifiers?: Array, propertyName?: Identifier, dotDotDotToken?: Node + , name?: Identifier | BindingPattern, initializer?: Expression): BindingElement { let node = createNode(SyntaxKind.BindingElement); if (arguments.length) { node.decorators = decorators && createNodeArray(decorators) @@ -522,8 +522,8 @@ namespace ts { } return node; } - export function updateBindingElement(node: BindingElement, decorators: Array, modifiers: Array, propertyName: Identifier, - name: Identifier | BindingPattern, initializer: Expression): BindingElement { + export function updateBindingElement(node: BindingElement, decorators: Array, modifiers: Array, propertyName: Identifier + , name: Identifier | BindingPattern, initializer: Expression): BindingElement { if (decorators !== node.decorators || modifiers !== node.modifiers || propertyName !== node.propertyName || name !== node.name || initializer !== node.initializer) { let newNode = createBindingElement(decorators, modifiers, propertyName, node.dotDotDotToken, name, initializer); @@ -553,8 +553,8 @@ namespace ts { } return node; } - export function updateObjectLiteralExpression(node: ObjectLiteralExpression, decorators: Array, modifiers: Array, - properties: Array): ObjectLiteralExpression { + export function updateObjectLiteralExpression(node: ObjectLiteralExpression, decorators: Array, modifiers: Array + , properties: Array): ObjectLiteralExpression { if (decorators !== node.decorators || modifiers !== node.modifiers || properties !== node.properties) { let newNode = createObjectLiteralExpression(decorators, modifiers, properties); return updateFrom(node, newNode); @@ -588,8 +588,8 @@ namespace ts { } return node; } - export function updateElementAccessExpression(node: ElementAccessExpression, expression: LeftHandSideExpression, - argumentExpression: Expression): ElementAccessExpression { + export function updateElementAccessExpression(node: ElementAccessExpression, expression: LeftHandSideExpression + , argumentExpression: Expression): ElementAccessExpression { if (expression !== node.expression || argumentExpression !== node.argumentExpression) { let newNode = createElementAccessExpression(expression, argumentExpression); return updateFrom(node, newNode); @@ -606,8 +606,8 @@ namespace ts { } return node; } - export function updateCallExpression(node: CallExpression, expression: LeftHandSideExpression, typeArguments: Array, - _arguments: Array): CallExpression { + export function updateCallExpression(node: CallExpression, expression: LeftHandSideExpression, typeArguments: Array + , _arguments: Array): CallExpression { if (expression !== node.expression || typeArguments !== node.typeArguments || _arguments !== node.arguments) { let newNode = createCallExpression(expression, typeArguments, _arguments); return updateFrom(node, newNode); @@ -624,8 +624,8 @@ namespace ts { } return node; } - export function updateNewExpression(node: NewExpression, expression: LeftHandSideExpression, typeArguments: Array, - _arguments: Array): NewExpression { + export function updateNewExpression(node: NewExpression, expression: LeftHandSideExpression, typeArguments: Array + , _arguments: Array): NewExpression { if (expression !== node.expression || typeArguments !== node.typeArguments || _arguments !== node.arguments) { let newNode = createNewExpression(expression, typeArguments, _arguments); return updateFrom(node, newNode); @@ -641,8 +641,8 @@ namespace ts { } return node; } - export function updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: LeftHandSideExpression, - template: LiteralExpression | TemplateExpression): TaggedTemplateExpression { + export function updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: LeftHandSideExpression + , template: LiteralExpression | TemplateExpression): TaggedTemplateExpression { if (tag !== node.tag || template !== node.template) { let newNode = createTaggedTemplateExpression(tag, template); return updateFrom(node, newNode); @@ -692,8 +692,8 @@ namespace ts { } return node; } - export function updateFunctionExpression(node: FunctionExpression, decorators: Array, modifiers: Array, name: Identifier, - typeParameters: Array, parameters: Array, type: TypeNode, body: Block | Expression + export function updateFunctionExpression(node: FunctionExpression, decorators: Array, modifiers: Array, name: Identifier + , typeParameters: Array, parameters: Array, type: TypeNode, body: Block | Expression ): FunctionExpression { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type || body !== node.body) { @@ -716,8 +716,8 @@ namespace ts { } return node; } - export function updateArrowFunction(node: ArrowFunction, decorators: Array, modifiers: Array, - typeParameters: Array, parameters: Array, type: TypeNode, body: Block | Expression + export function updateArrowFunction(node: ArrowFunction, decorators: Array, modifiers: Array + , typeParameters: Array, parameters: Array, type: TypeNode, body: Block | Expression ): ArrowFunction { if (decorators !== node.decorators || modifiers !== node.modifiers || typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type || body !== node.body) { @@ -897,8 +897,8 @@ namespace ts { } return node; } - export function updateClassExpression(node: ClassExpression, decorators: Array, modifiers: Array, name: Identifier, - typeParameters: Array, heritageClauses: Array, members: Array + export function updateClassExpression(node: ClassExpression, decorators: Array, modifiers: Array, name: Identifier + , typeParameters: Array, heritageClauses: Array, members: Array ): ClassExpression { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || heritageClauses !== node.heritageClauses || members !== node.members) { @@ -919,8 +919,8 @@ namespace ts { } return node; } - export function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: LeftHandSideExpression, - typeArguments: Array): ExpressionWithTypeArguments { + export function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: LeftHandSideExpression + , typeArguments: Array): ExpressionWithTypeArguments { if (expression !== node.expression || typeArguments !== node.typeArguments) { let newNode = createExpressionWithTypeArguments(expression, typeArguments); return updateFrom(node, newNode); @@ -1057,9 +1057,10 @@ namespace ts { } return node; } - export function updateForStatement(node: ForStatement, initializer: VariableDeclarationList | Expression, condition: Expression, - incrementor: Expression, statement: Statement): ForStatement { - if (initializer !== node.initializer || condition !== node.condition || incrementor !== node.incrementor || statement !== node.statement) { + export function updateForStatement(node: ForStatement, initializer: VariableDeclarationList | Expression, condition: Expression + , incrementor: Expression, statement: Statement): ForStatement { + if (initializer !== node.initializer || condition !== node.condition || incrementor !== node.incrementor || statement !== node.statement + ) { let newNode = createForStatement(initializer, condition, incrementor, statement); return updateFrom(node, newNode); } @@ -1075,8 +1076,8 @@ namespace ts { } return node; } - export function updateForInStatement(node: ForInStatement, initializer: VariableDeclarationList | Expression, expression: Expression, - statement: Statement): ForInStatement { + export function updateForInStatement(node: ForInStatement, initializer: VariableDeclarationList | Expression, expression: Expression + , statement: Statement): ForInStatement { if (initializer !== node.initializer || expression !== node.expression || statement !== node.statement) { let newNode = createForInStatement(initializer, expression, statement); return updateFrom(node, newNode); @@ -1093,8 +1094,8 @@ namespace ts { } return node; } - export function updateForOfStatement(node: ForOfStatement, initializer: VariableDeclarationList | Expression, expression: Expression, - statement: Statement): ForOfStatement { + export function updateForOfStatement(node: ForOfStatement, initializer: VariableDeclarationList | Expression, expression: Expression + , statement: Statement): ForOfStatement { if (initializer !== node.initializer || expression !== node.expression || statement !== node.statement) { let newNode = createForOfStatement(initializer, expression, statement); return updateFrom(node, newNode); @@ -1225,8 +1226,8 @@ namespace ts { } return node; } - export function updateVariableDeclaration(node: VariableDeclaration, decorators: Array, modifiers: Array, - name: Identifier | BindingPattern, type: TypeNode, initializer: Expression): VariableDeclaration { + export function updateVariableDeclaration(node: VariableDeclaration, decorators: Array, modifiers: Array + , name: Identifier | BindingPattern, type: TypeNode, initializer: Expression): VariableDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || type !== node.type || initializer !== node.initializer) { let newNode = createVariableDeclaration(decorators, modifiers, name, type, initializer); @@ -1263,8 +1264,8 @@ namespace ts { } return node; } - export function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Array, modifiers: Array, name: Identifier, - typeParameters: Array, parameters: Array, type: TypeNode, body: Block + export function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Array, modifiers: Array, name: Identifier + , typeParameters: Array, parameters: Array, type: TypeNode, body: Block ): FunctionDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || parameters !== node.parameters || type !== node.type || body !== node.body) { @@ -1287,8 +1288,8 @@ namespace ts { } return node; } - export function updateClassDeclaration(node: ClassDeclaration, decorators: Array, modifiers: Array, name: Identifier, - typeParameters: Array, heritageClauses: Array, members: Array + export function updateClassDeclaration(node: ClassDeclaration, decorators: Array, modifiers: Array, name: Identifier + , typeParameters: Array, heritageClauses: Array, members: Array ): ClassDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || heritageClauses !== node.heritageClauses || members !== node.members) { @@ -1311,8 +1312,8 @@ namespace ts { } return node; } - export function updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: Array, modifiers: Array, - name: Identifier, typeParameters: Array, heritageClauses: Array, members: Array + export function updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: Array, modifiers: Array, name: Identifier + , typeParameters: Array, heritageClauses: Array, members: Array ): InterfaceDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || heritageClauses !== node.heritageClauses || members !== node.members) { @@ -1333,8 +1334,8 @@ namespace ts { } return node; } - export function updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: Array, modifiers: Array, - name: Identifier, typeParameters: Array, type: TypeNode): TypeAliasDeclaration { + export function updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: Array, modifiers: Array, name: Identifier + , typeParameters: Array, type: TypeNode): TypeAliasDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || typeParameters !== node.typeParameters || type !== node.type) { let newNode = createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); @@ -1353,8 +1354,8 @@ namespace ts { } return node; } - export function updateEnumDeclaration(node: EnumDeclaration, decorators: Array, modifiers: Array, name: Identifier, - members: Array): EnumDeclaration { + export function updateEnumDeclaration(node: EnumDeclaration, decorators: Array, modifiers: Array, name: Identifier + , members: Array): EnumDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || members !== node.members) { let newNode = createEnumDeclaration(decorators, modifiers, name, members); return updateFrom(node, newNode); @@ -1372,8 +1373,8 @@ namespace ts { } return node; } - export function updateModuleDeclaration(node: ModuleDeclaration, decorators: Array, modifiers: Array, - name: Identifier | LiteralExpression, body: ModuleBlock | ModuleDeclaration): ModuleDeclaration { + export function updateModuleDeclaration(node: ModuleDeclaration, decorators: Array, modifiers: Array + , name: Identifier | LiteralExpression, body: ModuleBlock | ModuleDeclaration): ModuleDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || body !== node.body) { let newNode = createModuleDeclaration(decorators, modifiers, name, body); return updateFrom(node, newNode); @@ -1415,8 +1416,8 @@ namespace ts { } return node; } - export function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Array, modifiers: Array, - name: Identifier, moduleReference: EntityName | ExternalModuleReference): ImportEqualsDeclaration { + export function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Array, modifiers: Array + , name: Identifier, moduleReference: EntityName | ExternalModuleReference): ImportEqualsDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || name !== node.name || moduleReference !== node.moduleReference) { let newNode = createImportEqualsDeclaration(decorators, modifiers, name, moduleReference); return updateFrom(node, newNode); @@ -1434,8 +1435,8 @@ namespace ts { } return node; } - export function updateImportDeclaration(node: ImportDeclaration, decorators: Array, modifiers: Array, - importClause: ImportClause, moduleSpecifier: Expression): ImportDeclaration { + export function updateImportDeclaration(node: ImportDeclaration, decorators: Array, modifiers: Array + , importClause: ImportClause, moduleSpecifier: Expression): ImportDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || importClause !== node.importClause || moduleSpecifier !== node.moduleSpecifier) { let newNode = createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier); @@ -1525,8 +1526,8 @@ namespace ts { } return node; } - export function updateExportDeclaration(node: ExportDeclaration, decorators: Array, modifiers: Array, - exportClause: NamedExports, moduleSpecifier: Expression): ExportDeclaration { + export function updateExportDeclaration(node: ExportDeclaration, decorators: Array, modifiers: Array + , exportClause: NamedExports, moduleSpecifier: Expression): ExportDeclaration { if (decorators !== node.decorators || modifiers !== node.modifiers || exportClause !== node.exportClause || moduleSpecifier !== node.moduleSpecifier) { let newNode = createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier); @@ -1599,8 +1600,8 @@ namespace ts { } return node; } - export function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: Array, - closingElement: JsxClosingElement): JsxElement { + export function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: Array + , closingElement: JsxClosingElement): JsxElement { if (openingElement !== node.openingElement || children !== node.children || closingElement !== node.closingElement) { let newNode = createJsxElement(openingElement, children, closingElement); return updateFrom(node, newNode); @@ -1616,8 +1617,8 @@ namespace ts { } return node; } - export function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: EntityName, - attributes: Array): JsxSelfClosingElement { + export function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: EntityName + , attributes: Array): JsxSelfClosingElement { if (tagName !== node.tagName || attributes !== node.attributes) { let newNode = createJsxSelfClosingElement(tagName, attributes); return updateFrom(node, newNode); @@ -2017,10 +2018,10 @@ namespace ts { } return node; } - export function updateJSDocParameterTag(node: JSDocParameterTag, preParameterName: Identifier, typeExpression: JSDocTypeExpression, - postParameterName: Identifier, tagName: Identifier): JSDocParameterTag { - if (preParameterName !== node.preParameterName || typeExpression !== node.typeExpression || postParameterName !== node.postParameterName || - tagName !== node.tagName) { + export function updateJSDocParameterTag(node: JSDocParameterTag, preParameterName: Identifier, typeExpression: JSDocTypeExpression + , postParameterName: Identifier, tagName: Identifier): JSDocParameterTag { + if (preParameterName !== node.preParameterName || typeExpression !== node.typeExpression || postParameterName !== node.postParameterName + || tagName !== node.tagName) { let newNode = createJSDocParameterTag(preParameterName, typeExpression, postParameterName, node.atToken, tagName); return updateFrom(node, newNode); }