How can I fold comment blocks inside method blocks to be folded (outlined), just like methods and regions, etc.?
Asked
Active
Viewed 1.1k times
18
-
@Cody, not that I know of - I am using Resharper (v5), and I haven't seen this behavior. – camainc May 17 '11 at 20:12
-
Just taking a guess, as it's a pretty common add-on but not one that I see enough value in to spend my own hard-earned money on. You commented to Hans's answer that you had such a thing on your work machine, but were hoping to find out before you had a chance to look. Since that didn't turn out so well, what was the final discovery? Did you ever find out the name of the responsible extension? – Cody Gray - on strike May 17 '11 at 23:31
-
I don't know what I was smoking when I posted that I had seen it on my work machine...when I got back to work, it actually wasn't there. That's why I changed my question to a more generic request for information :-) – camainc May 18 '11 at 13:31
-
By the way, I used to think that about Resharper myself, until I started using it. Now I don't know how I worked without it. It is amazing. – camainc May 18 '11 at 13:32
3 Answers
33
- Select the block that you want to hide
- Ctrl+M+H
This needs to be done only once. The block will become collapsible afterwards.

Hong
- 17,643
- 21
- 81
- 142
-
1Any way to get fold (/hide-section) comments (/titles)? For example, getting the folds to display `Constructor Section` or `Getters & Setters...` instead of the automatic (and rather unexplanatory and eventually confusion-inducing) `...`? --- One of my favorite features in NetBeans...But still haven't learnt how to do it in VS (if there is any way in the first place), and this SO answer is the closest I've got to finding it on google... – CosmicGiant Jun 25 '16 at 03:37
-
2When you do this, it collapses the section down to `...` - is there a way to add a comment as what the collapsed section contains? For example `... - See Explanation Inside` – Nick Aug 24 '16 at 19:42
-
-
2
-
in my VS 2022 all this does is scroll up so the block I selected is not on screen anymore, that is not hiding, when I scroll back down the selected code is still there as before – GuidoG Oct 19 '22 at 08:07
2
Edit + Outlining + Start Automatic Outlining.

Hans Passant
- 922,412
- 146
- 1,693
- 2,536
-
That doesn't add outlining to comment blocks inside methods - at least not in my environment. It does add outlining to XML comment blocks, but that's not what I'm after. – camainc May 07 '11 at 18:04
-
-
Exactly...that's what I'm asking! What is the extension that does this? I know it exists, but I can't find it in the extensions gallery. – camainc May 07 '11 at 19:13
-
Hmm, that's not what you asked. SO might not be the best place to find out what you installed. Have a look-see when you get back to your work machine. – Hans Passant May 07 '11 at 19:36
-
Yeah, I was hoping to get an answer today, or I wouldn't have asked - I would just wait until I get back to work next week. – camainc May 07 '11 at 21:33
-3
I think it might be right...
도구 > 옵션 > 텍스트 편집기 > C/C++ > 서식 > 개요 > 문 블록에 개요 사용 : True --> 모든 블록에 folding/unfolding 사용 가능.
Tool > Option > Text Editor > C/C++ > Form > Outline > Use statement on the block overview : True --> Every block folding / unfolding can be used.

youmin3
- 1