在Visual Studio中隐藏XML注释 [英] Hiding XML Comments in Visual Studio

查看:112
本文介绍了在Visual Studio中隐藏XML注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,是否有一种方法可以将xml注释隐藏在每个方法的开头?这些注释很重要,但是当我跟踪错误或单步执行代码时,不需要看这些注释.

也不希望它们被折叠,我正在寻找使它们隐藏(甚至不可见)的解决方案.

Is there a way to hide the xml comments at the head of each method in visual studio? These comments are important, but I don''t need to see them when I''m tracking down bugs or stepping through code.

Not looking for them to be collapsed either, I''m looking for a solution that makes them hidden (not even visible).

推荐答案

写一个add-在VS2010中,它将为您做到这一点.标准版本不会为您隐藏这些版本,折叠是没有外接程序时最好的选择.但是,如果您编写该加载项,则可以为此赢得一些收益.

构建VS2010加载项并赢得Zune [收起VB .NET或C#中的所有XML注释 [
Write an add-in for VS2010 that will do that for you. The standard versions won''t hide those for you, collapsing is the best you can do without an add-in. But, if you write that add-in, you could win something on here for it.

Build a VS2010 Add-in and win a Zune[^]

Found this post that shows how to write a macro to change what is shown then it''s collapsed.

Collapse All XML Comments in VB .NET or C#[^]

Of course, it''s still collapsed, not hidden, but you could modify it to do what you''re wanting.


我通常会折叠所有东西.在VS 2005中,转到,将所有内容折叠到其基本定义,包括注释(也可以从上下文菜单中到达).这与在编辑器的左边缘使用小号正负号折叠所有内容具有相同的效果.然后,您可以扩展所需的方法,或者如果您逐行调试器中的内容,它将自动扩展您要进入的方法.在同一菜单项中,还有一些其他选项可用来进行其他折叠/展开功能.
I usually collapse everything. In VS 2005 go to to collapse everything to its base definition including the comments (you can also get there from the context menu). This has the same effect as using the little plus/minus sign in the left hand margin of the editor to collapse everything. Then you can expand just what methods you need, or if you''re stepping through things in the debugger line by line it will auto-expand methods that you step into. There are some other options in the same menu item to so some other collapse/expand functions.


您可以编写一个命令行实用程序,该实用程序将从空格开头的文件中删除所有行,然后至少在使用C#时使用三斜杠("///")....如果您的代码受版本控制,那应该不是问题.然后,您只需要将一个文件夹拖到工具上就可以了,这很神奇……应该花一两个小时才能写出来……如果您已经熟悉了正则表达式,那么花的时间会更少.
You could write a command-line utility that would remove all lines from files that start with whitespace and a triple slash ("///")... at least if you''re working with C#. If your code is under version control, that shouldn''t be a problem. Then you''d just have to drag a folder onto the tool and it would do it''s magic... shouldn''t take but an hour or two to write... less if you are already familiar with regular expressions.


这篇关于在Visual Studio中隐藏XML注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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