Tuesday, April 28, 2020

Collapse Comments (v1.4) and expand them

Comments (in code) can be really helpful. But, at other times they can get in the way of the code you're working on.

It's for the times when I just want the comments to get out the way that I created the Collapse Comments extension for Visual Studio 2019. It adds a simple command to collapse all the comments in the open document that you can invoke by pressing Ctrl+M, Ctrl+C.

I've just released version 1.4 and this includes something new. It includes the ability to do exactly the opposite of what I specified above. It adds another command that will expand all comments and collapse everything else.
It's not a scenario I have to deal with a lot but came as a suggestion (thanks Morten) who frequently looks at the decompiled code (and comments) that Visual Studio can generate. The generated file lists method names with comments (which are automatically collapsed upon opening) and it's the comments that are most important here for understanding all the different overloads. For this reason, it makes sense to be able to quickly expand all the comments by pressing Ctrl+M, Ctrl+D.


There's an option to control whether to treat using (or imports) directives like comments, and it works with C#, VB.NET, and XML documents.


Get it now, for FREE, from the Visual Studio Marketplace.

Got thoughts about this? Why not leave a comment below? I promise not to hide it away ;)

0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.