Skip to content

prince0xdev/code-sweap

Repository files navigation

🧹 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!


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

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published