Community
Participate
Working Groups
I200312020950 INSERT_SPACE_BEFORE/AFTER_COMMA_IN_FOR_INITS don't affect the formatting of commas in the initializer of a for loop. Instead, this is determined by INSERT_SPACE_BEFORE/AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS. Example: class Example { void foo() { for ( int i = 0,j = 100; i < 10; i++, j-- ) { ^^^^^^^^^^^^^^^ Other.enable(i, j); } } }
I will investigate.
I don't think I can fix this without introducing duplicate codes in the formatter and I really don't want this. The option INSERT_SPACE_BEFORE/AFTER_COMMA_IN_FOR_INITS was in fact never used, because it is already handled by the INSERT_SPACE_BEFORE/AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS. This is problematic since the new ui is using both options. I will clean up the code to see what I can do in this case.
This is inconsistent with the case where method invocations are used for the for initializers. Need to be fixed.
Fixed and released in HEAD. Regression tests added.
Verified for 3.0M6