You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this case I think the first comment could be on the next line, but if it complicated things too much it is not mandatory I think it just seems it could improve readability of the code.
@laeubi The comment gets connected to the return statement by the compiler and the cleanup doesn't actually look at it or manipulate. It simply copies the return statement (extended range which includes its comments) into the block via ASTRewrite. The rationale is that if you already had a block with such a comment at the end and were to make a new block and copy all the statements, you would want such a trailing comment to come along automatically and not require special processing. to find it. I think a new range computer is required to allow the caller to specify extended range but not to bring along comments that follow the line of the statement. I'll have a look at it.
Yes I already guessed it is not trivial, in this particular example you can only see by the indentation (what of course means nothing to the compiler) that the second comment does not belong to the first one.
When it is too complex I would say it is a corner case we most likely can not fix in an automated way and then should be fixed manually.
I found one case now from a review perspective it looks wrong:
https://github.com/eclipse-equinox/equinox/pull/796/files#diff-ebd60c200dde5c694d76b9ad0a08faa03db7b83c922cbc5666efe320d6099f5dR1350
Basically if a comment is following the line that is wrapped inside a block it is put inside the block.
I think one should only move comments before the statement into the block (or directly at the line of the statement) but not after that line.
FYI @jjohnstn
The text was updated successfully, but these errors were encountered: