Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Clear CommentsNew to Visual Studio Code? Get it now.
Clear Comments

Clear Comments

Toan Bui

|
149 installs
| (0) | Free
Clear Comments quickly removes comments from your code — perfect for cleaning up boilerplate or AI/ChatGPT-generated comments.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Clear Comments

VSCode Marketplace Version Installs Rating

Clear Comments is a Visual Studio Code and Cursor IDE extension designed to help you quickly remove comments from any code — including comments generated by ChatGPT or other AI tools.

Clear Comments in action

Note: Use Clear Comments to clean up generated code: if you paste in code scaffolded by ChatGPT (or any AI), simply invoke Clear Comments to eliminate all AI-generated commentary and get straight to the logic.

Cursor IDE Support: This extension is fully compatible with Cursor IDE, providing the same powerful comment removal functionality in your AI-powered development environment.

The extension processes the currently open document—or one or more files selected in the Explorer—using a simple mapping of language IDs to comment tokens. It removes entire lines that are solely comments and, when appropriate, strips out inline comment portions (only if the code before the comment marker is empty or ends with a semicolon (;) or a closing brace (})).

If you try to run Clear Comments on a file whose language isn’t supported, the extension will inform you via an information message.

Features

  • Supported Languages: JavaScript/TypeScript/TSX, C/C++/C#, Dart, VB, HTML/ASPX, and many more.
  • Inline Comment Removal: Strips inline comments when safe (ends with ; or }).
  • Non-destructive Editing: Applies changes in memory; review before saving.

Categories & Tags

  • Categories: Code Cleanup, Tools, Productivity, Formatter
  • Tags: comments, cleanup, AI, ChatGPT, code, vscode, cursor, developer-tools, productivity

Usage

Using the Explorer Context Menu

  1. In the Explorer view, right-click on one or more files.
  2. Select Clear Comments from the context menu.
  3. Review changes in memory; save manually if desired.

Using the Command Palette

  1. Open the file you want to process.
  2. Press Ctrl+Shift+P (or Cmd+Shift+P on macOS).
  3. Type Clear Comments and select the command.
  4. Review changes in memory; save manually if desired.

Supported File Types

  • C / C++: .c, .cpp, .h
  • C#: .cs
  • CoffeeScript: .coffee
  • Dart: .dart
  • F#: .fs
  • Go: .go
  • Handlebars: .hbs
  • HTML / ASPX: .html, .aspx
  • Jade / Pug: .jade, .pug
  • Java: .java
  • JavaScript: .js
  • Less: .less
  • Lua: .lua
  • Makefile: Makefile
  • PHP: .php
  • Rust: .rs
  • SCSS: .scss
  • ShaderLab: .shader
  • Shell / Bash: .sh
  • Swift: .swift
  • TypeScript / TSX: .ts, .tsx
  • VB: .vb
  • XML / XSL: .xml, .xsl
  • YAML: .yml, .yaml

If the language of the file is not supported by the extension, an information message will inform you, and no changes will be made.

Logging and Debugging

During processing, the extension logs key events and actions to the Developer Tools console. You can view these logs by opening Help > Toggle Developer Tools in the Extension Development Host. This is useful for understanding how your code is being processed and for troubleshooting any issues.

Contribution

Contributions, bug reports, and feature requests are welcome!
If you have suggestions or improvements, please open an issue or submit a pull request at our GitHub repository.

License

This extension is licensed under the ISC License.

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