https://github.com/estruyf/vscode-hide-comments
This extension started as a joke for people who do not like to see comments in the code. The extension will basically set all comments to transparent, they will not be removed.
https://github.com/estruyf/vscode-hide-comments
comments visibility
Last synced: about 1 year ago
JSON representation
This extension started as a joke for people who do not like to see comments in the code. The extension will basically set all comments to transparent, they will not be removed.
- Host: GitHub
- URL: https://github.com/estruyf/vscode-hide-comments
- Owner: estruyf
- License: mit
- Created: 2021-02-26T22:25:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T16:03:06.000Z (over 1 year ago)
- Last Synced: 2025-03-01T02:51:09.413Z (over 1 year ago)
- Topics: comments, visibility
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hide-comments
- Size: 585 KB
- Stars: 37
- Watchers: 3
- Forks: 4
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Hide Comments - VSCode Extension

This extension started as a joke for people who do not like to see comments in the code. The extension will set all comments to **transparent**. The extension will never remove the comments from the file.
> **Important**: Although it might have been started as a joke. There might be people out there that would actually like to hide the comments in their projects. That is why I will keep this project alive.
## Usage
When the extension is installed. You can use the `Hide Comments` commands to show or hide the comments.
If you want, you can also let the extension ask you each time when you start a new instance if you want to hide the comments. You can do this by enabling the `hideComments.defaultEnabled` setting. When this is set to `true`, you will get the following notification when you start a new instance:

When you choose **Yes** it will at the settings to your user settings for this project. If you decide **No**, nothing will happen at all.
## Menu editor title actions
On the editor title, a toggle action is available to show/hide the comments quickly.

> Note: In case you are using the `hideComments.regex` setting to hide additional lines with custom regex, you will have a second toggle action available.
## Settings
- `hideComments.backup`: Used to backup the previous comments value (if set). Default: `null`.
- `hideComments.color`: Defines the color for hiding the comments. Default: `#00000000`.
- `hideComments.defaultEnabled`: Define if you want to enable or disable the extension on startup of Visual Studio Code. Default: `false`.
- `hideComments.cleanStart`: Define if you want to start each instance by showing the comments in your files. Default: `true`.
- `hideComments.foldOnHide`: Define if you want to fold the comment blocks when hiding comments. Default: `true`.
- `hideComments.regex`: Specify the regular expression to use to hide additional lines. Default: `null`.
## Commands
The extension currently has the following commands:
1. `Hide Comments: Toggle the show/hide of all comments`
2. `Hide Comments: Hide all comments`
3. `Hide Comments: Show all comments`
4. `Hide Comments: Show lines by regex`: this command is only available when the `hideComments.regex` setting is set.
5. `Hide Comments: hide lines by regex`: this command is only available when the `hideComments.regex` setting is set.
### Keybindings
The extension does not have any default keybindings. You can add your own keybindings to the commands from within Visual Studio Code it UI. Steps to do this:
1. Open the command palette: `Ctrl+Shift+P` or `Cmd+Shift+P`;
2. Type the command you want to add a keybinding. Example: `Hide Comments: Toggle the show/hide of all comments`;
3. Click on the gear icon next to the command in the command palette. This opens the keyboard shortcuts editor;
4. Add your keybinding and you are all set.
## Hide additional lines by regex
In case you want to hide additional lines with a custom regex, you can use the `hideComments.regex` setting. Here is an example:
```json
{
"hideComments.regex": [
{
"regex": "console\\.log\\(([^)]+)\\).*",
"flags": "igm"
}
]
}
```
## Removing the extension
When you want to remove the extension, but still have the comments hidden. It is best to first run the `Hide Comments: Show all comments` command. This will make sure that all settings will be reset.
If you did already uninstall the extension, but still your comments are hidden. Here is what you can do:
- Open your workspace settings via: `Preferences: Open Workspace Settings (JSON)`
- Remove the following code from the JSON file:
```
"editor.tokenColorCustomizations": {
...
}
```
## Feedback / issues / ideas
Please submit them via creating an issue in the project repository: [issue list](https://github.com/estruyf/vscode-hide-comments/issues).