A VS Code extension to instantly and automatically remove all comments across various programming languages. Perfect for code minification, cleaning up debugging comments, or preparing your code for production.
- Auto-Language Detection: Automatically adjusts the removal pattern based on the file extension (
.js,.py,.html, etc.). - Inline Comment Removal: Deletes comments located right next to your code (e.g.,
code // comment). - Block Comment Removal: Clears multi-line comments along with their empty lines to keep your code clean and tidy.
- Supports 20+ Languages: JavaScript, TypeScript, Python, Java, C/C++, C#, PHP, Go, Rust, HTML, CSS, SQL, YAML, Bash, Ruby, Lua, and more.
- Open the code file you want to clear of comments.
- Open the Command Palette by pressing
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac). - Type "Remove All Comments".
- Press
Enter. All comments will vanish instantly!
If you want to assign a custom shortcut, you can configure it manually in VS Code:
- Open Keyboard Shortcuts (
Ctrl+KthenCtrl+S). - Search for the command:
Remove All Comments. - Double-click it and bind it to your preferred keys (e.g.,
Ctrl+Shift+Delete).
| Language | Extension | Removed Patterns |
|---|---|---|
| JavaScript / TS / Java / C++ | .js, .ts, .java, .cpp |
// ... and /* ... */ |
| Python / Ruby / YAML | .py, .yml, .rb |
# ..., """ ... """, and ''' ... ''' |
| HTML / XML / Markdown | .html, .xml, .md |
<!-- ... --> |
| CSS / SCSS | .css, .scss |
/* ... */ |
| SQL | .sql |
-- ... and /* ... */ |
| Visual Basic | .vb |
' ... |
This extension is open-source. If you find a programming language whose comment patterns are not correctly detected, please open an Issue or submit a Pull Request on our GitHub repository.
This application is licensed under the [MIT License.
