ReSharper - 是否有一个禁用命令可以添加到不允许类型成员重新排序的文件中?

发布于 2024-12-01 03:34:13 字数 326 浏览 1 评论 0原文

就像

 // ReSharper disable ConvertToAutoProperty

我想知道什么(如果存在)可以添加到特定文件(并且仅特定文件),以便在代码清理时不对字段进行排序。

有关更多信息:

  • 我知道可以在 R# 本身中设置一些设置。即使我不控制设置(例如在其他人的计算机上),这也需要工作,
  • 我知道我可以进行设置以禁用 TypeMembersLayout 中特定类型的排序。由于同样的原因,这也行不通。
  • 我只希望这种情况发生在我关心的文件上,而不是全局设置上。

Much like

 // ReSharper disable ConvertToAutoProperty

I would like to know what, if existing, I can add to particular files (and only particular files) so that fields are not sorted on code cleanup.

For more information:

  • I know there are settings one can set in R# itself. This needs to work even where I don't control settings (like on other people's computers)
  • I know I can make a setting to disable sorting for particular types in TypeMembersLayout. This also will not work due to the same reason.
  • I only want this to happen on files I care that it doesn't happen with, not a global setting.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮色兮凉城 2024-12-08 03:34:13

我已经使用 Resharper 多年了,可以自信地说这个选项不存在。不过好主意..

I've been using Resharper for years, and can say with confidence this option doesn't exist. Good idea though..

糖果控 2024-12-08 03:34:13

也许生成的代码选项可以帮助您。但我没有尝试。
转到 ReSharper-> 选项-> 代码检查-> 生成的代码并添加您的文件。
我认为 ReSharper 不会影响这些文件。

Maybe Generated Code options can help you. But I didn't try it.
Go to ReSharper->Options->Code Inspection->Generated Code and add your files.
I think ReSharper leaves such files untouched.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文