There is no way to to do an AST walk and get access to the final comment. Technically, the comment is leadingTrivia on the end sub token.
We may need to add a getEndTrivia() method on AstNode... for most nodes, it would empty, except for "block" type statements/expressions that have an end where it would get the leading trivia of the end token
Consider:
There is no way to to do an AST walk and get access to the final comment. Technically, the comment is
leadingTrivia
on theend sub
token.We may need to add a
getEndTrivia()
method on AstNode... for most nodes, it would empty, except for "block" type statements/expressions that have anend
where it would get the leading trivia of the end token