Met*_*urf 10 c# resharper namespaces using-statement visual-studio-2010
使用ReSharper移动/更新名称空间声明时,有没有办法阻止ReSharper删除未使用的Using语句?
换句话说,如果我有一个类,如:
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
namespace Foo.Bar
{
class MyClass
{
List<string> Names { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
我想使用ReSharper将它移动到Foo.Bar.Utilities命名空间,Resharper将删除所有未使用的Using语句,并留下我:
using System.Collections.Generic;
namespace Foo.Bar.Utilities
{
class MyClass
{
List<string> Names { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我不希望ReSharper在移动命名空间声明时触摸我的Using语句.我希望结果如下:
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
namespace Foo.Bar.Utilities
{
class MyClass
{
List<string> Names { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
Joe*_*Joe 13
我不认为你可以毫不含糊地这样做.
但是,可以选择指定不应删除的名称空间(Resharper Options - > C# - > Namespace Imports),但您需要知道哪些名称空间不需要删除.
归档时间: |
|
查看次数: |
2406 次 |
最近记录: |