Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Smart CleanerNew to Visual Studio Code? Get it now.
Smart Cleaner

Smart Cleaner

Unique Creators

|
1 install
| (0) | Free
A professional-grade VS Code extension for intelligent comment removal and code sanitation. Preserves strings, regex literals, and documentation. Produced by Unique Creators.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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.

Unique Creators

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

  1. Open a file in VS Code.
  2. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette.
  3. Type "Smart Remove Comments" and select it.
  4. 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:

  1. Press Ctrl+K then Ctrl+S (or Cmd+K Cmd+S on Mac) to open Keyboard Shortcuts.
  2. Search for Smart Remove Comments.
  3. Click the + icon or double-click the command.
  4. 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.

  • 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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft