Smart Cleaner
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.

Features
- Intelligent Removal: Distinguishes between comments and code, including complex cases like:
- Strings (Single, Double, Backticks)
- Regex Literals (
/pattern/flags in 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 / #endregion tags.
- Configurable: Support for custom comment markers for any language.
- Non-Blocking: Asynchronous processing prevents UI freezes on large files, with a cancellable progress indicator.
Supported Languages
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:
#.
Usage
- Open a file in VS Code.
- Press
Ctrl+Shift+P (or Cmd+Shift+P on 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.
Keyboard Shortcuts
Smart Cleaner doesn't assign a default keybinding to avoid conflicts, but you can easily assign your own:
- Press
Ctrl+K then Ctrl+S (or Cmd+K Cmd+S on 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.
Configuration
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
Feedback & Support
This project is produced by Unique Creators to provide a best-in-class solution for comment cleaning.
If you encounter any issues, please check our GitHub Repository or contact us directly.
© 2026 Unique Creators. All Rights Reserved.