开发者

c# #region/#endregion mismatch

Anyone know a good way to find out where i have 开发者_C百科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.


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:

c# #region/#endregion mismatch


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜