Is there a way to collapse all documentation headers (/// comments) in the current file in visual studio (2008+)?
views:
196answers:
3
+1
A:
You can try Ctrl+M, Ctrl+O
, but that will collapse function bodies as well.
Anton Gogolev
2010-01-22 10:56:40
Not exactly what I was looking for, but nice to know. What is the expand all shortcut now that I've collapsed everything in my file? :)
Veli
2010-01-22 11:32:12
@Veli: All the stuff you need is available from the Edit menu's Outlining submenu. Ctrl M M collapes / expands the currently active block, be it a comment, class or metod etc.
Ruben Bartelink
2010-01-22 11:46:09
+1
A:
What Anton said.
If what you want is not on Edit|Outlining, you'd need to write a macro or a DxCore plugin to walk it and Ctrl-M M each relevant block.
Ruben Bartelink
2010-01-22 10:58:52
yeah I figured that might be the case, I'm too lazy to collapse each one individually, let along write a plugin/macro... though would be a fun exercise if I ever get some free time :)
Veli
2010-01-22 11:33:07
@Veli: It is actually a very easy thing to do with DXCore, and there are lots of examples that do very similar traversals of a code tree. Or you could record a temporary macro that does a repeated find of `///` and a `Ctrl M M`. (Yes, I understand you were looking for something OOTB and if someone started stating the obvious like this at me I'd tell them where to go right now!)
Ruben Bartelink
2010-01-22 11:45:01
+4
A:
See my macro for collapsing XML comments which does exactly what you need.
Peter Macej
2010-01-22 13:09:46