Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Comment Cleaner ProNew to Visual Studio Code? Get it now.
Comment Cleaner Pro

Comment Cleaner Pro

Christlieb Dela

|
38 installs
| (2) | Free
Streamline your code by effortlessly removing comments across 20+ programming languages. Improve readability, reduce file size, and prepare code for production with powerful cleaning options and detailed statistics.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Comment Cleaner Pro

Version Downloads Issues Pull Requests License

Overview

Comment Cleaner Pro is a powerful VS Code extension for removing comments from source code files. It helps you streamline your code by efficiently removing all types of comments (line, block, and documentation) across 25+ programming languages while preserving the core functionality of your code.

Features

  • ✅ Removes all comment types (line, block, documentation, TODO/FIXME, and AI-generated) while preserving code functionality
  • ✅ Preserves meaningful comments for better readability
  • ✅ One-click cleanup with an easy-to-use command
  • ✅ Supports multiple programming languages
  • ✅ Automatic backups create safety files before removing comments
  • ✅ Detailed statistics track the number of comments and lines removed
  • ✅ Undo/Redo support to easily revert or restore changes
  • ✅ Configuration consistency across all entry points

Key Features

Comprehensive Language Support

  • 20+ Programming Languages - Supports all major languages including Python, JavaScript (including JSX), TypeScript (including TSX), HTML, CSS, C/C++, Java, Ruby, Go, PHP, SQL, Swift, Rust, Kotlin, and more
  • Intelligent Comment Detection - Accurately identifies and removes all comment types specific to each language
  • Preservation of Code Structure - Maintains code indentation and formatting while removing comments

Flexible Processing Options

  • Single File Processing - Clean comments from the current file with a single click
  • Batch Processing - Process multiple files simultaneously using glob patterns
  • Automatic Backups - Create safety backups before removing comments
  • Customizable Rules - Configure how unknown file types and special comments are handled
  • Configuration Persistence - Settings in the UI panel now properly apply to all operations
  • Clear Configuration Dialogs - Intuitive options when using context menu commands
  • Undo/Redo Support - Easily revert or reapply changes with dedicated undo/redo buttons

Enhanced User Experience

  • Modern UI Controls - Circular checkboxes with green indicators for selected options
  • Unlimited History - Track all cleaned files without arbitrary limits
  • Individual File Management - Remove specific files from history as needed
  • Responsive Design - UI elements maintain their shape and clarity at all window sizes

Detailed Statistics

  • Comment Count - Track the number of comments removed per file
  • Line Reduction - See exactly how many lines were removed
  • File Size Impact - Measure the size reduction achieved
  • Accurate Tracking - Now with improved accuracy in statistics tracking

Currently Supports

Category Languages
Web Development JavaScript TypeScript HTML5 CSS3 PHP
Systems Programming C C++ Rust Go
Enterprise Java C# Kotlin
Scripting Python Ruby Perl Bash Lua PowerShell
Data & Analysis SQL YAML R MATLAB
Mobile Development Swift Dart
Functional Haskell

Support for other languages is coming soon. Stay tuned!

Installation

  1. Open VS Code
  2. Go to Extensions view (Ctrl+Shift+X)
  3. Search for "Comment Cleaner Pro"
  4. Click Install

Requirements:

  • Visual Studio Code 1.50.0 or higher
  • Python 3.6 or higher

Usage Guide

Method 1: Clean Current File

  1. Open a source code file in the editor
  2. Right-click anywhere in the editor
  3. Select "Comment Cleaner Pro: Clean Current File"
  4. Configure your cleaning options:
    • Choose whether to create a backup
    • Select if TODO & FIXME comments should be preserved
    • Decide whether to keep documentation comments
    • Determine if unknown file types should be processed
  5. The editor will refresh automatically with comments removed according to your settings

Method 2: Command Palette

  1. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
  2. Type "Comment Cleaner Pro"
  3. Select "Comment Cleaner Pro: Clean Current File" or "Comment Cleaner Pro: Clean Multiple Files"
  4. Follow the prompts to configure options

Method 3: Activity Bar Integration

  1. Click the Comment Cleaner Pro icon in the Activity Bar
  2. Choose "Clean Current File" or "Clean Multiple Files"
  3. View your recently cleaned files in the "Cleaned Files" section
  4. Use Undo/Redo buttons to revert or restore changes as needed

Batch Processing Options

When cleaning multiple files:

  1. Enter a glob pattern to match files (e.g., *.js, src/**/*.py)
  2. Choose whether to create backups
  3. Decide if unknown file types should be processed
  4. Monitor progress in the notification area

Command-Line Usage

The extension includes a standalone Python script that can be used directly:

# Basic usage
python path/to/ccp.py "*.js"

# Process files recursively
python path/to/ccp.py "src/**/*.py" --recursive

# Preserve documentation comments
python path/to/ccp.py "*.java" --keep-doc-comments

# Preserve TODO comments
python path/to/ccp.py "*.cpp" --preserve-todo

# Don't create backups
python path/to/ccp.py "*.html" --no-backup

# Force processing of unknown file types
python path/to/ccp.py "*.custom" --force

Technical Details

Comment Cleaner Pro uses a sophisticated object-oriented architecture with dedicated language handlers to identify and remove comments while preserving code structure. The extension:

  • Handles nested comment structures
  • Preserves important comments like license headers when configured
  • Detects and properly processes character escapes in strings
  • Maintains code indentation and whitespace
  • Provides accurate line count reduction statistics

Performance Considerations

  • For very large files (10MB+), expect processing to take a few seconds
  • Batch processing uses multi-threading for better performance
  • Uses memory-efficient processing techniques for large files

FAQ

Does Comment Cleaner Pro modify my original files?

Yes, but you can enable backups which create .bak files before processing.

Can I undo the comment removal?

Yes, you can use the dedicated Undo button in the sidebar, use standard VS Code undo operations, or restore from the .bak backup files if you enabled backups.

Does it work with all programming languages?

It supports 20+ major languages. For unlisted languages, you can try the "force" option, but results may vary.

Does it work with embedded code like JavaScript in HTML files?

No, the current version only processes comments based on the file extension. JavaScript or CSS comments within HTML files will not be removed. We're actively working on adding support for embedded languages in a future release.

Privacy & Security

Comment Cleaner Pro:

  • Processes all files locally on your machine
  • Does not send any code or data externally
  • Requires no authentication or online services
  • Has minimal extension permissions

Project Information

View Changelog
Release History
Become a Contributor
Contributing
MIT License
License

Author

Created by Christlieb Dela

Thank you for using Comment Cleaner Pro!

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