Open khorvat opened 8 years ago
When "Insert regions" alone is turned on, we will do an in place addition of regions based on wherever the code elements are present. Regions do not participate in sorting and are effectively treated as a nesting level (think private class) so it's possible to have the following:
public void Method1() { }
#region Methods
public void Method2() { }
#endregion
In this case Method1 picks up a region wrapper but Method2 is left unaffected. This happens because Method1 and Method2 are not recognized as being at the same hierarchy level unless "Remove regions" is also enabled.
I think this highlights that we've allowed for too many configuration options, and some of the option combinations are not logically handled. Using insert without remove will cause the behavior you've described in the scenario above.
My first reaction is to remove the options to use insert without remove since it isn't handled by the existing logic.. but it needs further consideration.
Environment
Description
I have been playing around with settings while testing some other reported issue (#281) and turned off "Remove regions ..." now on every cleanup and reorganization I get new regions inserted multiple times.
Steps to recreate
Current behavior
Multiple regions are inserted in the code.
Expected behavior
Only one region per type should be inserted.