"Namespaces that should not be removed" doesn't work

We have a convention in my team to always specify the full name of types under a specific namespace (Engine.).  

So I've added the namespace in Options > Code Editing > C# > Namespace Imports: "Namespaces that should not be removed".

But this does not work. The namespace is always removed by Resharper whenever I refactor or do auto-completion.

For example, if I type:

List<Engine.MyClass> t = new

Resharper will propose adding new List<MyClass>() and will remove the namespace everywhere in the file and replace it with a using;

Any ideas how to prevent resharper from doing this?

Anthony Brien

Comment actions Permalink

That's not what the "namespaces that should not be removed" is for. The namespaces listed there are ones where the "using Namepsce;" directive will not be removed, even if it's not used.

There doesn't seem to be an option to do what you've described. It's something I'd like to see as well.

Comment actions Permalink

That's really sad it does not work this way. A "remove using directive  and requalify usages" quickfix would be really nice.


Please sign in to leave a comment.