Reshaper action - wrong formatting
Answered
Hello,
when i use action to create backing fields and PropertyChanged notifications using Reshaper on property like this:
public bool IsVisible { get; set; }
It generates code like this:
public bool IsVisible
{
get { return _isVisible; }
set
{
if (value == _isVisible) return;
_isVisible = value;
NotifyOfPropertyChange(() => IsVisible);
}
}
Which works fine, except our formatting rules dictate that the line with if must have the return statement in block :
public bool IsVisible
{
get { return _isVisible; }
set
{
if (value == _isVisible)
{
return;
}
_isVisible = value;
NotifyOfPropertyChange(() => IsVisible);
}
}
Event reshaper suggests this reformat:

So is there a way to generate properly formatted code, so i dont have to reformat after this action every time?
Please sign in to leave a comment.
Martin Stránský thank you for your question. Can you clarify the following "PropertyChanged notifications using Reshaper on property"? What do you mean by that?
Thanks in advance!
Martin Stránský thank you for your reply! I was able to reproduce the problem on my side, please comment/vote for https://youtrack.jetbrains.com/issue/RSRP-455917 to get the notifications about status changes. As a workaround, you can apply code cleanup after applying the "To property with ... call" context action. Sorry for the inconvenience.