prince0xdev / code-sweep

Remove and uncomment your code in one click. Supports multiple languages including more 30 most used languages.

Home Page:https://marketplace.visualstudio.com/items?itemName=prince0xdev.codesweep

Repository from Github https://github.comprince0xdev/code-sweepRepository from Github https://github.comprince0xdev/code-sweep

🧹 CodeSweep

Visual Studio Marketplace Installs Marketplace Version GitHub Repo stars GitHub forks

CodeSweep is a lightweight, open-source VS Code extension that helps you clean your code by removing all comments and debug logs in one click.

Perfect for preparing production-ready code or cleaning up before sharing with teammates.


✨ Features

  • πŸ—‘οΈ Remove all single-line comments (//, #, --, ;, etc.)
  • 🧼 Remove all multi-line comments (/* ... */, <!-- ... -->, etc.)
  • 🐞 Clean up debug statements like console.log, print(), System.out.println, etc.
  • 🌐 Supports 30+ popular languages (JavaScript, HTML, Python, PHP, C++, etc.)
  • ⚑ Simple, fast, and effective

πŸ“¦ Installation

  1. Open the VS Code Marketplace
  2. Click Install

Or install via the VS Code command palette:


βš™οΈ Usage

  • Open any code file
  • Press Ctrl+Shift+P or Cmd+Shift+P on Mac
  • Type and run: CodeSweep: Clean Code
  • πŸ’₯ Done! Comments and debug logs are gone

πŸ–±οΈ Usage via menu clic droit (context menu)

You can also run CodeSweep commands directly from the right-click menu inside your code editor.

  • Open a supported code file (e.g., .js, .py, .java, .html, etc.)
  • Right-click anywhere in the editor
  • Select one of the CodeSweep commands, like:
    • CodeSweep: Clean Code
    • CodeSweep: Remove All Comments
    • CodeSweep: Remove Single Line Comments
    • CodeSweep: Remove Multiline Comments
    • CodeSweep: Remove Debug Logs

This offers a quick and convenient way to clean your code without using the Command Palette.

🧩 Available Commands

CodeSweep offers 4 useful commands. You can access them all via the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).


πŸ”Ή CodeSweep: Clean Code

codesweep.cleanCode

βœ… Recommended Command – Runs a full cleanup of your code.

This command executes:

  • Remove Multiline Comments
  • Remove Debug Logs

Ideal before pushing to production or sharing your code.


πŸ”Ή CodeSweep: Remove All Comments

codesweep.removeAllComments

βœ… Removes all single-line and multi-line comments from the entire file.

Examples removed:

// This comment is gone
/* This too */
/*
Multi-line
block removed
*/
<!-- This in HTML is also removed -->

πŸ”Ή CodeSweep: Remove Single Line Comments

codesweep.removeSingleLineComments

βœ… Only removes single-line comments, preserving multiline ones.

Examples removed:

# A Python comment
// A JS comment
-- A SQL comment

πŸ”Ή CodeSweep: Remove Multiline Comments

codesweep.removeMultilineComments

βœ… Removes only multi-line comments, useful when you want to preserve inline hints.

Examples removed:

/*
  This block is gone
*/
// This one stays
<!-- HTML-style comments are removed -->

πŸ”Ή CodeSweep: Remove Debug Logs

codesweep.removeDebugLogs

βœ… Detects and removes debug logs like:

console.log("Hello")
print("Debug")
System.out.println("Trace")
debugger;

And many more, depending on language.

Helps prevent accidental debug logs in production code.

πŸ’» Supported Languages

Includes but not limited to:

  • JavaScript, TypeScript, HTML, CSS
  • Python, PHP, Ruby, Go, Rust, C/C++, Java
  • Bash, PowerShell, Shell, YAML, JSONC, XML, etc.

🧠 Why CodeSweep?

Because no one wants to ship console.log("hello") or outdated comments to production πŸ˜‰
CodeSweep helps keep your codebase clean, professional, and production-ready.


🀝 Contributing

Contributions are now open!

  • πŸ“– Please read our Contribution Guide
  • πŸ› Found a bug or have a suggestion? Open an issue Thank you for helping make CodeSweep better! πŸ™Œ

πŸ“œ License

MIT License – free to use, modify, and distribute.


πŸ§ͺ Demo

Gif demo coming soon! CodeSweep Demo


🧩 Got Feedback or Found a Bug?

Open an issue here πŸ‘‰ GitHub Issues

About

Remove and uncomment your code in one click. Supports multiple languages including more 30 most used languages.

https://marketplace.visualstudio.com/items?itemName=prince0xdev.codesweep

License:Other


Languages

Language:TypeScript 95.8%Language:JavaScript 4.2%