(Note: This, 7-year-old reply refers to a JetBrains request for this feature which was subsequently marked as "done" in 2017. But they've rearranged their Options dialog since then and I cannot find the equivalent. So I am posting again)
I'm typing a switch statement in C#. When the case statements are short, I generally want to line them up in columns because it makes the code easier to grasp at a glance. So for example, I might want it look like this
switch (XyLengthUnit)
{
case LengthUnit.CM: _precision = 6; break;
case LengthUnit.MM: _precision = 3; break;
}
And mostly it works. But every time I get to the end of a line and type the semicolon, Resharper insists on moving the break
down to the next line
switch (XyLengthUnit)
{
case LengthUnit.CM: _precision = 6; break;
case LengthUnit.MM: _precision = 3;
break;
}
So I have to hit backspace to fix it. Every time.
I am sure that it is Resharper doing this because when I disable it, the behavior stops and my 'break' statement remains on the same line.
I've gone through every single setting under Resharpers Options >> Code Editing >> C# >> Formatting Style >> Tabs, Indents, Alignment Nothing there seems to change this. I found a few settings under "Line Breaks and Wrapping that seemed appropriate (and related the previously mentioned feature request) but they did not change the behavior
(This is how I have the settings now but I've monkeyed with them extensively. They do not seem to change anything. As soon as I hit semicolon, the break
gets moved)
I know that many Resharper settings have "hard breaks" at a certain column and all that but I generally set those to really high numbers (e.g. column 150).
Is there a setting for it that I am missing? Is it possible to make Resharper align things like this?