Summary: | Formatter isn't //$NON-NLS-1$ aware | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Erich Gamma <erich_gamma> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | P3 | ||
Version: | 2.0 | ||
Target Milestone: | 2.0 M6 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Erich Gamma
2002-04-23 05:01:11 EDT
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. |