In Visual Studio 2017 for C#, is there a way to leave one-line if statements on one line without affecting the formatting of other control blocks? The "Place open brace on new line for control blocks" rule under "Text Editor > C# > Code Style > Formatting > New Lines" will allow if statements to remain on one line, but it will also force all other control blocks to have the curly bracket on the same line.
For example, I'd like the following statement's formatting to be left alone:
if(x == null) { return; }
Instead of being auto-formatted to this:
if(x == null)
{ return; }
While also allowing other control statements to keep their curly bracket on the next line like this:
foreach(string s in strings)
{
....
}