Comment Remover Pro - VS Code ExtensionCOMMENT REMOVER PRO
Table of Contents📍 OverviewComment Remover Pro is a powerful VS Code extension that safely removes comments from your entire codebase while preserving comment-like text inside strings. Perfect for code minification, obfuscation, cleaning, and production preparation. Why use Comment Remover Pro?
Perfect for:
✨ Key Features🛡️ Safe & Smart Removal
🔄 Complete Workflow
⚙️ Advanced Configuration
📊 Detailed Reporting
🌐 Supported LanguagesWeb Development:
Backend & Systems:
Scripting:
Shell & Scripts:
Configuration & Data:
Documentation:
And many more! (Total: 50+ file types) 📁 Project Structure
📂 Project Index
|
| extension.ts | Main extension implementation with language handlers and processing logic |
out
extension.js Compiled JavaScript extension code extension.js.map Source maps for debugging
Configuration Files
package.json VS Code extension manifest with commands and configuration tsconfig.json TypeScript compiler configuration .vscodeignore Files to exclude from the extension package
🚀 Getting Started
⚡ Quick Installation
From VS Code Marketplace:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Comment Remover Pro"
- Click Install
From VSIX file:
- Download the latest
.vsixfile from releases - In VS Code: Extensions → ⋮ → Install from VSIX...
- Select the downloaded file
- Download the latest
🔨 Building from Source
Prerequisites:
- Node.js (v14 or higher)
- npm or yarn
- TypeScript compiler
- VS Code Extension Development Tools
Build Steps:
# 1. Clone the repository
git clone https://github.com/nabil-devs/comment-remover-pro.git
cd comment-remover-pro
# 2. Install dependencies
npm install
# 3. Compile TypeScript
npm run compile
# 4. Package the extension
npx @vscode/vsce package
# 5. Install the generated .vsix file in VS Code
# - Open Extensions view
# - Click "..." → "Install from VSIX..."
# - Select comment-remover-pro-X.X.X.vsix
🤖 Usage
Three Ways to Use:
Command Palette (Recommended):
- Press
Ctrl+Shift+P - Type "Remove All Comments from Workspace"
- Press Enter
- Press
Explorer Context Menu:
- Right-click any folder in Explorer
- Select "Remove All Comments from Workspace"
Keyboard Shortcut:
Ctrl+Shift+/(Windows/Linux)Cmd+Shift+/(Mac)
Workflow:
1. Preview → Review changes without modifying files
2. Apply → Remove comments (creates automatic backup)
3. Undo → Restore from backup if needed
⚙️ Configuration
Customize the extension in VS Code Settings (Ctrl+,):
{
"commentRemoverPro.backup.enabled": true,
"commentRemoverPro.fileExtensions": [".js", ".ts", ".py", ".html"],
"commentRemoverPro.remove.singleLine": true,
"commentRemoverPro.remove.multiLine": true,
"commentRemoverPro.excludePatterns": [
"**/node_modules/**",
"**/.git/**",
"**/dist/**"
]
}
Configuration Options:
backup.enabled: Create backups before modification (default: true)backup.location: Backup directory locationfileExtensions: Array of file extensions to processremove.singleLine: Remove single-line comments (//, #, --)remove.multiLine: Remove multi-line comments (/* */, )remove.shebang: Remove shebang lines (#!/usr/bin/env)excludePatterns: Glob patterns to exclude from processing
🛡️ Safety Features
🔐 Backup System
- Automatic timestamped backups
- Configurable backup location
- Backup metadata storage
- Automatic cleanup of old backups
👁️ Preview Mode
- Shows exactly what will be removed
- No changes made to files
- Statistics about potential modifications
- Option to apply or cancel
↩️ Undo Functionality
- One-click restore from most recent backup
- Backup history tracking
- Safe rollback mechanism
🚨 Safety Checks
- Modal confirmation before destructive operations
- Cancellable operations at any time
- Error handling with detailed logging
- Skip read-only and system files
🎯 Use Cases
1. Production Code Preparation
// Before: Development code with comments
const apiUrl = "https://api.example.com"; // Development API
const debugMode = true; // TODO: Set to false in production
// After: Clean production code
const apiUrl = "https://api.example.com";
const debugMode = true;
2. Code Minification & Obfuscation
Remove comments to reduce file sizes before:
- Bundling with Webpack/Rollup
- Deploying to production servers
- Distributing proprietary code
3. Educational Code Examples
Create clean examples by removing:
- Development notes
- TODO/FIXME comments
- Debug statements
- Internal documentation
4. Legacy Code Cleanup
Remove outdated comments from:
- Old codebases
- Migrated projects
- Deprecated functionality
📌 Project Roadmap
✅ Completed
- [X] Core Comment Removal: Basic comment removal for major languages
- [X] String Preservation: Smart detection of comment-like text in strings
- [X] Preview Mode: Safe preview without file modification
- [X] Backup System: Automatic backups before changes
- [X] Multi-language Support: 50+ programming languages
- [X] VS Code Integration: Commands, menus, and configuration
🚧 In Progress
- [ ] Advanced Pattern Matching: Regex-based custom comment patterns
- [ ] Language-specific Settings: Per-language configuration
- [ ] Batch Size Optimization: Improved performance for large projects
📋 Planned
- [ ] Cloud Backup Integration: Backup to cloud storage services
- [ ] Team Collaboration: Shared settings and templates
- [ ] AI-Powered Analysis: Smart comment categorization
- [ ] Code Style Preservation: Maintain formatting while removing comments
- [ ] VS Code Workspace Trust: Enhanced security features
🔰 Contributing
We welcome contributions! Here's how you can help:
Ways to Contribute
- Report Bugs: Found an issue? Open an issue
- Suggest Features: Have an idea? Start a discussion
- Submit PRs: Want to code? Check open issues
- Improve Docs: Fix typos or improve documentation
Development Setup
# 1. Fork and clone
git clone https://github.com/nabil-devs/comment-remover-pro.git
cd comment-remover-pro
# 2. Install dependencies
npm install
# 3. Run in development mode
npm run watch
# 4. Press F5 to launch extension development host
# 5. Make changes and test
Code Guidelines
- Follow TypeScript best practices
- Add tests for new features
- Update documentation
- Use meaningful commit messages
- Follow existing code style
Pull Request Process
- Create a feature branch
- Make your changes
- Add/update tests
- Update documentation
- Submit PR with description
🎗 License
This project is licensed under the MIT License - see the LICENSE file for details.
Permissions:
- ✅ Commercial use
- ✅ Modification
- ✅ Distribution
- ✅ Private use
- ✅ Sublicensing
Limitations:
- ❌ Liability
- ❌ Warranty
Conditions:
- © Include original copyright notice
- © Include license copy
🙌 Acknowledgments
Built With
- Visual Studio Code - The best code editor
- TypeScript - Type-safe JavaScript
- Node.js - JavaScript runtime
Inspiration
- Inspired by the need for clean, production-ready code
- Built for developers who value code quality and performance
- Created to solve real-world code maintenance challenges
Special Thanks
- The NovaDev Team for making this possible
- The open-source community for invaluable tools and libraries
- All contributors and users who help improve this extension
If this extension helps you, consider giving it a ⭐ on GitHub!
Disclaimer: Always back up your code before using automated tools. While Comment Remover Pro is designed to be safe, the developers are not responsible for any data loss. Use the preview feature first!