Why should I choose between two code style braces options?

I want automatically remove redundant braces except if-else construtions where any part requires braces.
But I suppose that multiline body requires braces too, but cannot select both of these options.
With first option selected I get such result:
if (!_isEnabled)
return -1;
if (r <= _truncationRadius)
result = DensityLaw(r);
else
result = _truncationType switch
{
TruncationType.None => 0,
TruncationType.Sharp => 1,
TruncationType.Exponential => 2,
_ => throw new Exception(),
};
With second underlined option I get this:
if (!_isEnabled)
return -1;
if (r <= _truncationRadius)
result = DensityLaw(r);
else
{
result = _truncationType switch
{
TruncationType.None => 0,
TruncationType.Sharp => 1,
TruncationType.Exponential => 2,
_ => throw new Exception(),
};
}
But my goal is to get this:
if (!_isEnabled)
return -1;
if (r <= _truncationRadius)
{
result = DensityLaw(r);
}
else
{
result = _truncationType switch
{
TruncationType.None => 0,
TruncationType.Sharp => 1,
TruncationType.Exponential => 2,
_ => throw new Exception(),
};
}
Is it possible?
Please sign in to leave a comment.
Hello Nugies!
Thank you for contacting Rider Support.
The feature is not available yet. However, we have a corresponding request on our bug tracker. We would appreciate it if you would upvote the issue to demonstrate additional interest and bring increased awareness to the issue.
If you have any other questions, do not hesitate to ask. Have a great day!