Gets the range to use for a node when emitting comments.
(node *ast.Node)
| 566 | |
| 567 | // Gets the range to use for a node when emitting comments. |
| 568 | func (c *EmitContext) CommentRange(node *ast.Node) core.TextRange { |
| 569 | if emitNode := c.emitNodes.TryGet(node); emitNode != nil && emitNode.flags&hasCommentRange != 0 { |
| 570 | return emitNode.commentRange |
| 571 | } |
| 572 | return node.Loc |
| 573 | } |
| 574 | |
| 575 | // Sets the range to use for a node when emitting comments. |
| 576 | func (c *EmitContext) SetCommentRange(node *ast.Node, loc core.TextRange) { |
no test coverage detected