Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CommentRemoverNew to Visual Studio Code? Get it now.
CommentRemover

CommentRemover

jojihatzz

|
11 installs
| (0) | Free
CommentRemover is a VS Code extension designed to automatically remove comments from code files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CommentRemover

CommentRemover is a VS Code extension that helps you clean up your code by removing comments from your files. It works with multiple languages and gives you control over how comments are processed, making your code cleaner and potentially reducing file size.

More Info


[ALPHA] Please note that this extension is currently in alpha stage. While it provides useful functionality, there may be occasional bugs or issues. We appreciate your feedback to help improve this extension!


CommentRemover in action


Features

  1. Remove comments from:

    • Single files
    • Entire workspaces
    • Selected folders
    • Selected text
  2. Smart detection of comment patterns in various languages

    • Built-in presets for popular languages
    • Automatic detection of custom comment patterns
  3. Context menu integration

    • Right-click on files and folders
    • Process selected text or entire files
  4. Preview comments removal before applying changes

    • See a side-by-side comparison of before/after
    • Make informed decisions before removing comments
  5. Undo functionality

    • Restore comments immediately after removal
    • Undo operations on single files or batches

How to Use

Basic Usage

  1. Open a file in VS Code
  2. Run the command "CommentRemover: Remove Comments from Active File"
  3. Choose to preview changes or remove comments directly
  4. If comments are removed, an "Undo" option will appear in the notification

Preview Changes

  1. Open a file in VS Code
  2. Right-click and select "CommentRemover: Preview Comment Removal"
  3. A diff view will show the file with and without comments
  4. Choose "Apply Changes" to proceed or close the diff view to cancel

Batch Operations

  1. For workspace-wide operations, use "CommentRemover: Remove Comments from Workspace"
  2. For folder operations, right-click on a folder and select "Comment Remover: Remove Comments from Folder"
  3. After processing, you can:
    • View a list of all changed files
    • Undo all changes with a single click

Selection-Based Features

  1. If selecting a whole line, you'll get additional options:
    • Add comment pattern to presets
    • Remove comments from selection
    • Remove comments from this line only
  2. If selecting part of a line, the extension will try to detect comment patterns to add to presets

Language Support

The extension comes with presets for these languages:

  • JavaScript
  • Python
  • HTML
  • And more...

For languages without built-in support, you can either:

  • Add comment patterns using the right-click context menu
  • Enter custom patterns manually when prompted

Extension Settings

This extension contributes the following settings:

  • commentRemover.languagePresets: Language presets for comment symbols
  • commentRemover.customSettings: Custom comment settings for languages not covered by presets

Known Issues

  • The extension may not correctly handle comments in complex string literals
  • Some specialized comment formats may not be supported


Enjoy cleaner code with Comment Remover!

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