Skip to content

Commit cddc72a

Browse files
committed
always give container
1 parent 603ba89 commit cddc72a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/services/formatting/formatting.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ namespace ts.formatting {
566566
if (tokenInfo.token.end > node.end) {
567567
break;
568568
}
569-
consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation);
569+
consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node);
570570
}
571571

572572
function processChildNode(
@@ -617,7 +617,7 @@ namespace ts.formatting {
617617
break;
618618
}
619619

620-
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation);
620+
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node);
621621
}
622622

623623
if (!formattingScanner.isOnToken()) {
@@ -673,11 +673,11 @@ namespace ts.formatting {
673673
computeIndentation(tokenInfo.token, startLine, Constants.Unknown, parent, parentDynamicIndentation, parentStartLine);
674674

675675
listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta);
676-
consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation);
676+
consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent);
677677
}
678678
else {
679679
// consume any tokens that precede the list as child elements of 'node' using its indentation scope
680-
consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation);
680+
consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent);
681681
}
682682
}
683683
}
@@ -697,13 +697,13 @@ namespace ts.formatting {
697697
// without this check close paren will be interpreted as list end token for function expression which is wrong
698698
if (tokenInfo.token.kind === listEndToken && rangeContainsRange(parent, tokenInfo.token)) {
699699
// consume list end token
700-
consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation);
700+
consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent);
701701
}
702702
}
703703
}
704704
}
705705

706-
function consumeTokenAndAdvanceScanner(currentTokenInfo: TokenInfo, parent: Node, dynamicIndentation: DynamicIndentation, container?: Node): void {
706+
function consumeTokenAndAdvanceScanner(currentTokenInfo: TokenInfo, parent: Node, dynamicIndentation: DynamicIndentation, container: Node): void {
707707
Debug.assert(rangeContainsRange(parent, currentTokenInfo.token));
708708

709709
const lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine();

0 commit comments

Comments
 (0)