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 authored and GitHub committed 2017-08-09 14:27:37 -07:00
1 parent f28f5fd041
commit a6f37f55e4
10 files changed
+22 -22

No files matched your search

+1 -1
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);