Skip to content

A professional-grade VS Code extension for intelligent comment removal and code sanitation. Preserves strings, regex literals, and documentation. Produced by Unique Creators.

License

Notifications You must be signed in to change notification settings

UniqueCreators/smart-cleaner

Repository files navigation

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.

If you encounter any issues, please check our GitHub Repository or contact us directly.


© 2026 Unique Creators. All Rights Reserved.

About

A professional-grade VS Code extension for intelligent comment removal and code sanitation. Preserves strings, regex literals, and documentation. Produced by Unique Creators.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published