Translation drops comments from C code
As of #364, translation no longer preserves comments in C code. Comments are critical for the continued maintenance of a codebase, so we should do all we can to make it possible to preserve them across translation.
Much of the machinery for reinserting comments is still present, but someone needs to find the right way to traverse the AST to locate the node at which comments need to be placed. The question of where to place comments that do not precede an AST node also needs to be addressed, as comments are now internally represented as (outer) attributes, which need a syntax node to be an attribute of.
Have any potential solutions been considered for this recently?
Yes. Currently we're working on an LLM-based heuristic for determining the right locations to place comments in transpiled output. This is not to say that we're hostile to improvements to the deterministic handling of comments, but it isn't currently being worked on as it is constrained by the limitations of the attribute-based comment representation used by prettyplease and the syn AST representation (i.e. with this representation, comments cannot be placed before arbitrary tokens in the output).