Community
Participate
Working Groups
Build 20020328 If a line containing a single line comment at the end of line is too long, the comment can end up on a separate line. It should stay with the line, even if that makes the line too long. The comment refers to the line, and should not stand alone. This would also fix up some occurrences of the $NON-NLS$ tags getting divorced from the appropriate expression.
I'm strongly in favor of this idea, it would solve the NON-NLS tag problem nicely.
This would rather mean that a line with a trailing comment cannot be split alltogether. This sounds quite doable, Olivier ?
This would still not address the problem of formatting the following: someObject.someMethod( "my.id", // $NON-NLS 3); However, I still think it would be an improvement. For the case above, you could decide not to merge if there's an end of line comment.
Don't know the side-effects yet. Need more investigation.
The best I can do with the existing tool is not to format a line that contains a line comment. See 14387 for examples.
This suits me. Or, if we don't want to do this for all end of line comments, we could add a special case for $NON-NLS$ tags.
I added a special case for $NON-NLS$ comment in the formatter. Lines containing such a comment are not formatted anymore. If this doesn't work as expected, reopen this PR.
Will try it out, thanks.