(token, pos, writer, contextNode, indentLeading)
| 112618 | writeTrailingSemicolon(); |
| 112619 | } |
| 112620 | function emitTokenWithComment(token, pos, writer, contextNode, indentLeading) { |
| 112621 | var node = ts.getParseTreeNode(contextNode); |
| 112622 | var isSimilarNode = node && node.kind === contextNode.kind; |
| 112623 | var startPos = pos; |
| 112624 | if (isSimilarNode && currentSourceFile) { |
| 112625 | pos = ts.skipTrivia(currentSourceFile.text, pos); |
| 112626 | } |
| 112627 | if (isSimilarNode && contextNode.pos !== startPos) { |
| 112628 | var needsIndent = indentLeading && currentSourceFile && !ts.positionsAreOnSameLine(startPos, pos, currentSourceFile); |
| 112629 | if (needsIndent) { |
| 112630 | increaseIndent(); |
| 112631 | } |
| 112632 | emitLeadingCommentsOfPosition(startPos); |
| 112633 | if (needsIndent) { |
| 112634 | decreaseIndent(); |
| 112635 | } |
| 112636 | } |
| 112637 | pos = writeTokenText(token, writer, pos); |
| 112638 | if (isSimilarNode && contextNode.end !== pos) { |
| 112639 | var isJsxExprContext = contextNode.kind === 288 /* SyntaxKind.JsxExpression */; |
| 112640 | emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ !isJsxExprContext, /*forceNoNewline*/ isJsxExprContext); |
| 112641 | } |
| 112642 | return pos; |
| 112643 | } |
| 112644 | function commentWillEmitNewLine(node) { |
| 112645 | return node.kind === 2 /* SyntaxKind.SingleLineCommentTrivia */ || !!node.hasTrailingNewLine; |
| 112646 | } |
no test coverage detected
searching dependent graphs…