(node *ast.Node, emitFlags EmitFlags, commentRange core.TextRange, containerPos int, containerEnd int, declarationListContainerEnd int)
| 5419 | } |
| 5420 | |
| 5421 | func (p *Printer) emitTrailingCommentsOfNode(node *ast.Node, emitFlags EmitFlags, commentRange core.TextRange, containerPos int, containerEnd int, declarationListContainerEnd int) { |
| 5422 | pos := commentRange.Pos() |
| 5423 | end := commentRange.End() |
| 5424 | skipTrailingComments := end < 0 || (emitFlags&EFNoTrailingComments) != 0 || node.Kind == ast.KindJsxText |
| 5425 | if (!ast.PositionIsSynthesized(pos) || !ast.PositionIsSynthesized(end)) && pos != end { |
| 5426 | // Restore previous container state. |
| 5427 | p.containerPos = containerPos |
| 5428 | p.containerEnd = containerEnd |
| 5429 | p.declarationListContainerEnd = declarationListContainerEnd |
| 5430 | |
| 5431 | // Emit trailing comments if the position is not synthesized and the node |
| 5432 | // has not opted out from emitting leading comments and is an emitted node. |
| 5433 | if !skipTrailingComments && node.Kind != ast.KindNotEmittedStatement { |
| 5434 | p.emitTrailingComments(end, commentSeparatorBefore) |
| 5435 | } |
| 5436 | } |
| 5437 | } |
| 5438 | |
| 5439 | func (p *Printer) emitLeadingSyntheticCommentsOfNode(node *ast.Node, emitFlags EmitFlags) { |
| 5440 | if emitFlags&EFNoLeadingComments != 0 { |
no test coverage detected