How to prevent ReSharper from shortening namespaces when adding using directives?

你离开我真会死。 提交于 2019-12-21 07:56:08

问题


When I use ReSharper to add a using directive (using Alt+Enter) it removes "unnecessary" parts of the namespace. I prefer using the full namespace which is also the behavior of Visual Studio.

Example:

namespace MyCompany.MyTool.Data
{
    // This is what ReSharper gives me:
    using Core;

    // This is what I want:
    using MyCompany.MyTool.Core;

    // ...
}

Which setting do I have to change in ReSharper 4.5 so it uses the full namespace?


回答1:


I don't have ReSharper 4.5 installed at the moment, but in 5.0 there's an option at the Namespace Imports pane called Prefer fully qualified using name at nested scope. It might be the one you're looking for.



来源:https://stackoverflow.com/questions/1964501/how-to-prevent-resharper-from-shortening-namespaces-when-adding-using-directives

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!