thanos icon indicating copy to clipboard operation
thanos copied to clipboard

Comment translation is unsupported

Open redneckbeard opened this issue 3 years ago • 0 comments

The Ruby parse tree stores all comments by line number, and every node is annotated with the source line number, but the Go stdlib's AST package makes it exceedingly difficult to insert them -- essentially by byte offset from the beginning of the file, which does not exist as we are building the target. I think that the only way to get them into the target is to supply the token.Pos by dumping a given section of the target AST to string as you go, evaluating its length, adding comments at that position if one corresponds to the ruby line number, and increment a position variable accordingly.

redneckbeard avatar Feb 13 '22 12:02 redneckbeard