Add a leading space on binary operator token trailing comments (#17691)

* Add a leading space on token trailing comments

* Demystify comment
This commit is contained in:
Wesley Wigham
2017-08-09 14:27:37 -07:00
committed by GitHub
parent f28f5fd041
commit a6f37f55e4
10 changed files with 22 additions and 22 deletions

View File

@@ -1348,7 +1348,7 @@ namespace ts {
increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined);
emitLeadingCommentsOfPosition(node.operatorToken.pos);
writeTokenNode(node.operatorToken);
emitTrailingCommentsOfPosition(node.operatorToken.end);
emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts
increaseIndentIf(indentAfterOperator, " ");
emitExpression(node.right);
decreaseIndentIf(indentBeforeOperator, indentAfterOperator);