diff --git a/src/services/format.ts b/src/services/format.ts index 525fc3b6041..eb0e7b9aa5b 100644 --- a/src/services/format.ts +++ b/src/services/format.ts @@ -431,24 +431,7 @@ module ts.formatting { } } - var increaseIndentation = SmartIndenter.nodeContentIsAlwaysIndented(child.kind); - if (!increaseIndentation) { - switch (child.kind) { - case SyntaxKind.IfStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.FunctionExpression: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.Method: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - increaseIndentation = true; - break; - } - } - if (increaseIndentation) { + if (shouldIndentChildNodes(child.kind)) { childDelta = options.IndentSize; }