Sometimes I need hide a lot of comments for show code C++ in Visual studio 2012. Is it possible do it by one or two clicks?
-
https://stackoverflow.com/questions/44060551/how-do-you-hide-arbitrary-section-of-code-in-vs-code This can possibly solve your problem. – Rishabh Sharma Jul 28 '19 at 05:58
4 Answers
If you have a comment block, then there should be a "-" (minus) symbol at the top left of the block which lets you collapse it:
/* <---- Collapse button to the left of this
Comment
block.
*/
If you want to do more than this (e.g. hide ALL comments), then I'm not aware of any built-in way to do this, but you may want to take a look at this add-on which claims to do just that.
According to this answer all the plug-in does is change the color of comments to be the same as your background color, so it should be easy to achieve the result manually or via your own macro / plugin (if you can't get the one on that link to work for your version of VS). This strikes me as a rather inelegant solution (you'll have what appears to be (but isn't) whitespace where the comments were, which could make it easy to accidentally erase them), but it may suit your purposes.
Near the top of the comment section there should be a minus button which will shrunk the code down to one line. Clicking the plus icon that appears will reveal the comments again.
Similarly this is available for functions or sections of code in braces.

- 2,221
- 2
- 18
- 21
I suffer the same issue, but in VS Code. Sorry for the unrelated answer, but I hope it provides value to someone.
VS Code has an option to fold all Block Comments. In Ubuntu, the keyboard shortcut is Ctrl + K, Ctrl + /.

- 612
- 5
- 19
http://visualstudiogallery.msdn.microsoft.com/03141ea7-c35e-4533-b05b-9e60545e93eb
this plugin seems to do a great job at comment display.

- 3,269
- 1
- 27
- 48
-
This plugin is working for C# only as stated in the plugin description but the question is tagged "C++". – Andreas Jan 21 '15 at 14:46