Visual Studio或Resharper功能,用于放置使用指令 [英] Visual Studio or Resharper functionality for placement of using directives

查看:139
本文介绍了Visual Studio或Resharper功能,用于放置使用指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢将我的using指令放置在当前名称空间中,而不是放置在VS和Resharper的默认设置中.

I like to put my using directives inside the current namespace, and not outside as VS and Resharper per default puts them.

有人知道宏/标准功能可使用指令对未使用的指令进行排序/删除并将其放在当前名称空间内吗?

Does anyone know of a macro/standard functionality that sorts/removes unused using directives and puts them inside the current namespace?

推荐答案

更新-ReSharper 2016.1 :此选项现已移至代码编辑→C#→代码样式→添加使用"最深范围的指令

您是否尝试过ReSharper选项:

Have you tried the ReSharper option:

语言→C#→格式设置样式→命名空间导入→使用using指令添加到最深的作用域

我不确定R#的代码清理是否会为您重新排序现有代码.

I'm not sure whether R#'s code cleanup will reorder the existing ones for you though.

这篇关于Visual Studio或Resharper功能,用于放置使用指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆