Reputation: 519
I have a codebase with many comments, how can I hide these, without deleting them since I will need them later.
I want to hide all the comments with one click or keystroke, not a simple collapse of one comment at a time.
Upvotes: 15
Views: 15448
Reputation: 21
According to this reference page you can use Ctrl+K Ctrl+/
to fold all block comments.
Upvotes: 1
Reputation: 1
You can download from inside Visual Studio 2022 called unobtrusive code and it will hide all comments and put "+" symbols on the collapsed line to the left of your code that you can open or close them with. It works great.
*** TO GET THE EXTENSION: ***
I went to the Extensions menu at the top of VS 2022 and chose manage extensions. Then in the manage extensions window that opens up, choose online then Visual Studio Marketplace. In the search at the top right of the manage extensions window type in unobtrusive code. download it and then exit Visual Studio. You should see a window pop up to install it.
When you start VS 2022 again and open a C# script, it should have all the comments minimized to the "plus symbols" to the left of the code!
Hope it works for anyone wanting to hide their comments.
Upvotes: -1
Reputation: 642
Hide Comments - Visual Studio Marketplace
We now have an extension for that. On the editor title, a toggle action is available to show/hide the comments quickly.
Upvotes: 6
Reputation: 1345
I was looking for a way to do that too as I put way too many comments making it hard to debug... and I came across this https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hide-comments it makes all the comments invisible, but it leaves special characters in place. There are also commands to toggle show/hide.
Upvotes: 7
Reputation: 108
Can't find such feature as well. Read this issue from GitHub - https://github.com/Microsoft/vscode/issues/46505
Seems like that VSCode can't do it (from the box) and all people waiting for that feature.
Upvotes: 5