Community
Participate
Working Groups
The //$NON-NLS comments should never be broken on a new line by the formatter since this changes the run-time behaviour of a program.
Olivier - would it be hard to address ?
There is nothing easy when it is about changing the formatter.
I can easily change the fact that a line is split when too long if it contains //$NON-NLS. Is this what we want? For example if I have: System.out.println("lnzlkjnzlkjnklndflnafl;nfl;sknfl;" + "skfnl;kfnsl;knfkl;sdnfl " + ";ksnfl;knfs"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ It would remain on a single line. If I remove the NON-NLS tags, I get: System.out.println( "lnzlkjnzlkjnklndflnafl;nfl;sknfl;" + "skfnl;kfnsl;knfkl;sdnfl " + ";ksnfl;knfs"); If we want: System.out.println( "lnzlkjnzlkjnklndflnafl;nfl;sknfl;"//$NON-NLS-1$ + "skfnl;kfnsl;knfkl;sdnfl "//$NON-NLS-2$ + ";ksnfl;knfs");//$NON-NLS-3$ Then it is really difficult to get this with the actual implementation. Let me know if the first solution is sufficient.
Please update the PR if you want to see the code released.
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.