From f2329846cbc52074f9eb0affaecae2e406880dd5 Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Sun, 13 Sep 2015 04:02:18 +0900 Subject: [PATCH] apply suppression to tokens --- src/services/formatting/formatting.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 868683bb6af..8a713dc032c 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -387,9 +387,7 @@ namespace ts.formatting { let indentation = inheritedIndentation; if (indentation === Constants.Unknown) { - if (SmartIndenter.shouldInheritParentIndentation(parent, node) || - SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - + if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { indentation = parentDynamicIndentation.getIndentation(); } else { @@ -590,6 +588,10 @@ namespace ts.formatting { return inheritedIndentation; } + if (SmartIndenter.shouldInheritParentIndentation(parent, child)) { + parentDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation, 0); + } + if (isToken(child)) { // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules let tokenInfo = formattingScanner.readTokenInfo(child);