Better Comments is a Visual Studio extension that helps you create human-readable, categorized comments. This version features a high-performance parsing engine inspired by popular VSCode extensions.
- Multi-line Support: Highlight entire blocks of code in
/* ... */,<!-- ... -->, or(* ... *). - VSCode-Style Parsing: Uses the same tag detection logic as VSCode (supports tags anywhere in the line, with optional parameters).
- Custom Tags: Define your own comment tags with custom colors or map them to existing types.
- Wide Language Support: C#, C++, JavaScript, TypeScript, Python, F#, VB, Markup (HTML/XML), Rust, and Go.
- Deduplicated Rendering: Optimized to prevent overlapping tags and flickering in the editor.
Start your comment section with a tag followed by a colon. Tags are case-insensitive.
ERR:,ERROR:,FIX:,FIXME:- Example:
// ERR: This logic is broken
WARN:,WARNING:- Example:
/* WARNING: Use with caution */
TODO:,IDEA:,OPTIMIZE:- Example:
// TODO: Refactor this method
NOTE:,INFO:- Example:
<!-- INFO: This is a shared component -->
Define your own tags via Tools -> Options -> Better Comments -> Custom Tags:
- Example:
// REVIEW: Check this implementation - Example:
// HACK: Temporary workaround
You can include optional parameters in parentheses:
- Example:
// TODO(Artem): Finish this
Customize the extension via Tools -> Options -> Better Comments:
- Font & Size: Offset the comment font size relative to the editor.
- Opacity & Italics: Make your comments subtle or prominent.
For each comment type (Critical, Warning, Ideas, Info):
- Bold: Make the comment bold.
- Underline: Add underline decoration.
- Highlight keyword only: Show only the tag keyword, not the entire comment.
Add your own tags that map to existing types or use custom colors.
To customize the colors of each category:
- Go to Tools -> Options -> Environment -> Fonts and Colors.
- Select Text Editor in the dropdown.
- Find items starting with
Better Comments(e.g.,Better Comments - Critical).
| Language | Comment Styles |
|---|---|
| C# | //, /* */ |
| C/C++ | //, /* */ |
| JavaScript/TypeScript | //, /* */ |
| Python | # |
| F# | //, (* *) |
| Visual Basic | ' |
| Markup (HTML/XML) | <!-- --> |
| Rust | //, /* */ |
| Go | //, /* */ |
Contributions are welcome! Check out our Contribution Guidelines.
Licensed under the Apache 2.0 License.