Reputation: 18743
Is there a way to prevent Visual Studio (2010) "Format document" menu to format the switch-case
statements as the following:
When I write my code like:
switch (value) {
case "1": mode = Mode.One; break;
case "2": mode = Mode.Two; break;
}
And then hit "Format document", Visual Studio adds break lines:
switch (value) {
case "1":
mode = Mode.One;
break;
case "2":
mode = Mode.Two;
break;
}
I have looked into the Formatting section of VS Options, but I can't find anything relevant.
(I do not have ReSharper installed)
Upvotes: 8
Views: 1542
Reputation: 18743
Found the setting that caused this:
Options > Text Editor > C# > Formatting > Wrapping > Leave statements and member declarations on the same line
must be checked.
Upvotes: 7