Smart Cleaner is a professional-grade VSCode extension produced by Unique Creators. It intelligently removes comments from your source code while strictly preserving strings, regex literals, and other syntax elements.
- Intelligent Removal: Distinguishes between comments and code, including complex cases like:
- Strings (Single, Double, Backticks)
- Regex Literals (
/pattern/flagsin JS/TS) - Nested structures
- Clean Output:
- Comment-Only Lines: Completely removes lines that contain only comments, cleaning up whitespace and newlines.
- Block Comments: Properly handles multiline block comments and indentation.
- Smart Formatting: Automatically consolidates consecutive empty lines.
- Smart Capabilities:
- Preserve Documentation: Option to keep JSDoc/DocStrings (
/**,""") while removing code comments. - Remove Debug Statements: Option to strip
console.log,print, etc. - Region Cleanup: Option to remove
#region/#endregiontags.
- Preserve Documentation: Option to keep JSDoc/DocStrings (
- Configurable: Support for custom comment markers for any language.
- Non-Blocking: Asynchronous processing prevents UI freezes on large files, with a cancellable progress indicator.
Out of the box, Smart Cleaner supports:
- JavaScript / TypeScript:
//,/* ... */, strings, regex literals. - Python:
#, strings. - Java / C / C++ / C# / Go / Rust:
//,/* ... */. - SQL / Lua:
--,/* ... */(SQL),--[[ ... ]](Lua). - HTML / XML:
<!-- ... -->. - Ruby / Perl / Shell / YAML / Dockerfile:
#.
- Open a file in VS Code.
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) to open the Command Palette. - Type "Smart Remove Comments" and select it.
- The extension will process the file, removing comments while showing a progress bar.
Smart Cleaner doesn't assign a default keybinding to avoid conflicts, but you can easily assign your own:
- Press
Ctrl+KthenCtrl+S(orCmd+KCmd+Son Mac) to open Keyboard Shortcuts. - Search for
Smart Remove Comments. - Click the
+icon or double-click the command. - Press your desired combination (e.g.,
Ctrl+Alt+C) and hit Enter.
You can customize comment removal behavior in your settings.json:
"smartCleaner.languages": {
"my-custom-lang": {
"line": "//",
"block": ["(*", "*)"],
"strings": {
"double": true
}
}
},
"smartCleaner.keepDocumentation": true,
"smartCleaner.removeDebugStatements": false,
"smartCleaner.maxConsecutiveEmptyLines": 1,
"smartCleaner.removeRegions": false,
"smartCleaner.statusBarMessageTimeout": 3000,
"smartCleaner.yieldThreshold": 5000
This project is produced by Unique Creators to provide a best-in-class solution for comment cleaning.
- Website: www.uniquecreators.net
- Email: support@uniquecreators.net
If you encounter any issues, please check our GitHub Repository or contact us directly.
© 2026 Unique Creators. All Rights Reserved.