时间:2019-03-17 标签:c##region/#endregionmismatch
有人知道一个好方法来找出我的代码中哪里有额外的 #region 或 #endregion 吗?我有大约 5000 行 C# 代码,我现在正在尝试手动完成。任何帮助表示赞赏。
Anyone know a good way to find out where i have an extra #region or #endregion in my code? I have about 5000 lines of c# code and i'm trying to do it manually right now. Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
执行 CTRL+M CTRL+L - 关闭所有区域。然后在左侧一次展开它们(小
+
符号),直到看到没有匹配的#endregion
的#region XXX
应该看起来像这样:
Do CTRL+M CTRL+L - to close up all the regions. Then expand them one at a time on the left (little
+
sign) until you see#region XXX
that doesnt have matching#endregion
Should look like this:
单击 Ctrl+M, M 将会折叠所有正确匹配的区域。不匹配的不会被折叠,因此您可以修复它。
Click
Ctrl+M, M
it will collapse all properly matching regions. The one that doesn't match will not be collapsed so you can fix it.当您使用快捷方式折叠全部时会发生什么?
CTRL+M CTRL+O - 非递归地折叠所有区域
它应该折叠除具有不匹配。
What happens when you use the shortcuts to collapse all?
CTRL+M CTRL+O - Collapse all regions not recursively
It should collapse all but the region that has the mismatch.
我自己就遇到了这个问题,
对我来说找出删除结束区域的最简单方法是与源代码管理中的最后一个文件进行比较。
然后该行就会突出显示并且很容易找到。
Just had this issue myself,
easiest way for me to find out where I had deleted an endregion was to do a compare with the last file in source control.
the line was then highlighted and easy to find.