Community
Participate
Working Groups
Build ID: I20071213-1700 Steps To Reproduce: 1.preferences>java>editor>save actions :select 'perform the selected action on save', select 'format source code' , and select and format edited line. 2.add some whitespace at the end of any java line and save.> the line in formatted but the trailing spaces are still there. Note that it work correctly if 'format all lines' is selected or with the normal format action. More information:
Benno, please investigate.
I can not reproduce, neither in HEAD nor in 3.4 M4. Please provide exact steps: How does the code look like you are trying to format? Can you provide an example? What are your formatter settings? Can you attach your formatter profile? Does this happen in 3.4 M5 too? Thanks.
Had a hard time to reproduce with a clean workspace/project but finally got something. It seems to depends on the location of the wihtespaces/lengh of the file : with a class like that public class test { public static final String addingherework = "t"; public static final String shortbefore2 = "t"; public static final String toto = "adding spaces here don't work"; public static final String shortAfter = "t"; } If I add some whitespaces after the first attribute line they are correctly discarded while if I add some at the third attribute line they are not discarded... That is with M4 , defaults settings except for the few 'save actions' ones.
Thanks! Very strange. Given fresh workspace: public class Test { public static final String addingherework = ""; } 1. Add 11 (or less) spaces after the ';' 2. Select the complete line with the field, from start to end, including spaces 3. Source>Format Is: Trailing spaces are removed 4. Add 12 (or more) spaces after the ';' 5. Select the complete line with the field, from start to end, including spaces 6. Source>Format Is: Trailing spaces stay Hint1: For testing you can enable show whitespace characters in the preferences Hint2: Format edited line has the same problem, it's the same code I've verified that we call DefaultCodeFormatter.format(int, String, IRegion[], int, String) with the same options in both cases (except of course the region which have a different length) Moving to core
It works since 3.5.0. I guess this is a consequence of the fix for bug 234583...
Verified.