semantic-diffsemantic-merge

Moving first item with nested regions using Semantic Merge


In the rearrange file tool moving an item that is the first item within a region also moves the #region line. These moves are generally intended to rearrange items within the region. There also seems to be odd things happening intermittently when using nested regions (such as the regions becoming out of line or opening region tags being removed.)

How can I avoid those problems? Do I need to change some configuration?


Solution

  • I'm afraid that this is the behavior of the tool at the moment, due to the regions are considered as comments by the parser.

    For example, the #region member is considered as comment of the Method1. So, if you move Method1, the comment, as part of Method1, is moved with it.

              #region Members
    
              public void Method1()
              {
                  ...
              }
    
              public void Method2()
              {
                  ...
              }
    
              #endregion
    

    We have already noticed this behavior and it is included in the known issues list. We will work on it.