- User Since
- Dec 14 2019, 4:06 AM (10 w, 6 d)
Jan 24 2020
I have an issue with this change. Currently (at least for C++), the presence of a trailing comma is used as a formatting hint to put all the element in one line or one per line as below:
Jan 20 2020
Jan 11 2020
Jan 7 2020
Jan 5 2020
Jan 4 2020
Updated unittest to check under the column limit and over the column limit.
Dec 30 2019
Dec 28 2019
I'm not sure creating a special case for else/catch is the best idea. I would seem better to change the control statement @ line 309 to add it the case where we break before else or catch (add a new || test in the middle condition). I'm really new to this code too, so I don't know if it's better to check that previous line as a right curly brace and that BeforeElse/Catch is true and that first token of the line is else or catch or if just checking that the first token of the line is else or catch (or a mix in between). I'll let a more senior reviewer advise on this.
Dec 27 2019
Is there a reason why this option adds space before and after the tok::arrow token but not the tok::arrowstar token? That seems inconsistent to me.
So, you are trying to fix the issue at the wrong place. Contrary from what we should expect from a UnwrappedLine, BWACS_Multiline works by always wrapping the brace in UnwrappedLineParser, and afterwards in UnwrappedLineFormatter merging it back to the control statement if it's not in multi-line. The bug is on the control statement @ line 308 on UnwrappedLineFormatter.cpp. That's the block that merge the brace back to its control statement if it is not a multiline and it's executed only with a line with a else or a catch that begins with right curly brace.
Your code still breaks MultiLine
Set line length to column limit + 1 (41) in tests