I've always written simple one line if statements in the following style when they are concise and semantically clear (contrived example):
foreach (var item in list)
{
if (item == null) continue;
// ...
}
However as of some version of VS2017, it is now insisting that the above should become:
foreach (var item in list)
{
if (item == null)
continue;
// ...
}
I dislike the latter (yeah, I get that some people will dislike the style I actually do want), and every time I copy and paste code it re-formats automatically. I'm getting close to just turning off formatting entirely to prevent this, but does anybody know if there's a toggle to change this without negatively affecting everything else? I've trawled through the options trying everything that sounded related, but no luck. This style has always been supported in VS2013+, and if I remember correctly it even worked when VS2017 first came out.
Aucun commentaire:
Enregistrer un commentaire