How do I prevent Code Cleanup from simplifying/removing redundant qualifiers in type declarations with "Arrange Qualifiers" enabled?

I have tried a variety of settings, but I can't seem to find the way to prevent Code Cleanup from removing redundant qualifiers / simplifying qualifiers in type declarations when "Arrange Qualifiers" enabled.  Here is a primitive example of the problem:

namespace TestNamespace
public class Class1

public class Class2 : TestNamespace.Class1

When I run Code Cleanup, it changes "TestNamespace.Class1" to "Class1" in the Class2 declaration.  Prior to running Code Cleanup, the light bulb shows "IDE0001 Name can be simplified" -- if that helps.

Any ideas on how I can prevent Code Cleanup from removing my fully-qualified references in declarations if "Arrange Qualifiers" is enabled?

Oops, forgot to mention this is in VS 2015 Community in a vNext class library if that matters.

1 comment
Comment actions Permalink

Changing "Redundant name qualifier" to "Do not show" in "Inspection Severity" resolved this issue.

I will say this did throw me a bit due to the following profile settings I was using:

  1. Both "Remove code redundancies" boxes were unchecked  (when considering this setting is under the "Redundancies in Code" heading in "Inspection Severity")
  2. "Shorten qualified references" was unchecked.

As an aside, I am curious as to whether there is a list that cross-references the settings in "Code Cleanup" with their respective various ReSharper settings.  Or, something like right-clicking one of the checkbox-options in "Code Cleanup" to show a list of the settings that will take effect (and maybe even allow you to change them there?) would be a pretty nice feature.

Anyways, problem solved!


Please sign in to leave a comment.