Enclosing "using" directives in region on Code Cleanup with File Layout enabled
I am having a wierd issue getting Resharper to enclose the using directives in a region when I have File Layout enabled as part of the Code Cleanup and I can't seem to figure out what is causing it. The issue I am having is that when I run the code cleanup with the aforementioned settings, a new region is added for the using directive each time I run the code cleanup, resulting in duplicate region declarations.
So for example, if I were to start with the following code segment:
using System;
namespace ExampleNamespace
{
public class ExampleClass { }
}
The first time I run the Code Cleanup I would get the following:
#region Namespaces
using System;
#endregion
namespace ExampleNamespace
{
public class ExampleClass
{
}
}
If I run the Code Cleanup again, I end up with the following:
#region Namespaces
#region Namespaces
using System;
#endregion
namespace ExampleNamespace
{
public class ExampleClass
{
}
}
An extra region for namespaces has been added above. I don't believe that this is the expected behaviour, especially since it does not occur if I turn off the apply File Layout during Code Cleanup setting. I have tried changing settings in the File Layout to see if there is a specific one that is causing this behaviour but nothing seems to fix it.
Is this what is supposed to happen or is there some conflict in the settings between the two that is causing this issue? Thanks in advance.
Please sign in to leave a comment.
Hello!
Thank you for contacting us.
Could you please provide your settings from all layers (as described here) and XAML for Default Pattern in File Layout feature.
You can do it privately via 'Submit a request' form.
Thank you.
Thank you. As per your instructions I have submitted the documentation via the aforementioned form.