⚠️ Disclaimer ⚠️
This is not the official Visual Studio Code or Microsoft extension. This is a community-created extension that enhances code readability by highlighting comments and console methods with customizable colors and styles.
Features
- Highlights single-line and multi-line comments in different programming languages
- Customizable colors and opacity for comment highlighting
- Supports multiple programming languages:
- JavaScript/TypeScript
- Python
- Ruby
- PHP
- Rust
- Swift
- Kotlin
- Java
- C/C++
- C#
- Go
- HTML
- CSS/SCSS/Less
Console Method Highlighting
- Highlights different console methods with distinct colors:
- JavaScript-style (lowercase):
console.log
console.warn
console.error
console.table
- C#-style (PascalCase):
Console.Write
Console.WriteLine
- Case-sensitive highlighting (methods must match exact case)
- Customizable colors and opacity for each console method
- Whole line highlighting with left border
- Bold method names for better visibility
Installation
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X)
- Search for "Highlight Comments and Consoles"
- Click Install
Usage
The extension works out of the box with default settings. To customize the highlighting:
- Open VS Code Settings (Ctrl+,)
- Search for "Highlight Comments"
- Modify the colors and opacity settings as desired
Available Settings
{
"highlightComments.singleLineCommentColor": "#6A9955",
"highlightComments.multiLineCommentColor": "#6A9955",
"highlightComments.commentBackgroundOpacity": 20
}
Console Method Settings
{
"highlightComments.consoleLogColor": "#4EC9B0",
"highlightComments.consoleWarnColor": "#DCDCAA",
"highlightComments.consoleErrorColor": "#F44747",
"highlightComments.consoleTableColor": "#9CDCFE",
"highlightComments.consoleWriteColor": "#FF5733",
"highlightComments.consoleWritelineColor": "#9CDCFE",
"highlightComments.consoleBackgroundOpacity": 20
}
- Colors should be specified in hex format (e.g., "#FF5733")
- Opacity values range from 0 to 100
Supported Languages
The extension supports highlighting in the following languages:
- JavaScript/TypeScript (
.js
, .ts
, .jsx
, .tsx
)
- Python (
.py
)
- Ruby (
.rb
)
- PHP (
.php
)
- Rust (
.rs
)
- Swift (
.swift
)
- Kotlin (
.kt
)
- Java (
.java
)
- C/C++ (
.c
, .cpp
, .h
, .hpp
)
- C# (
.cs
)
- Go (
.go
)
- HTML (
.html
, .htm
)
- CSS/SCSS/Less (
.css
, .scss
, .less
)
Features in Detail
- Single-line comments are highlighted with a customizable color and opacity
- Multi-line comments are highlighted with the same styling
- Comments maintain their original text color while having a background highlight
- Left border indicates the presence of comments
Console Method Highlighting
- Each console method has its own distinct color
- Methods are highlighted with a background color and left border
- Method names are displayed in bold
- Whole line highlighting makes it easy to spot console statements
Requirements
- VS Code version 1.60.0 or higher
Extension Settings
This extension contributes the following settings:
highlightComments.singleLineCommentColor
: Color for single-line comments
highlightComments.multiLineCommentColor
: Color for multi-line comments
highlightComments.commentBackgroundOpacity
: Background opacity for comments (0-100)
highlightComments.consoleLogColor
: Color for console.log
highlightComments.consoleWarnColor
: Color for console.warn
highlightComments.consoleErrorColor
: Color for console.error
highlightComments.consoleTableColor
: Color for console.table
highlightComments.consoleWriteColor
: Color for console.write
highlightComments.consoleWritelineColor
: Color for console.writeline
highlightComments.consoleBackgroundOpacity
: Background opacity for console methods (0-100)
Known Issues
Release Notes
See the CHANGELOG.md file for release notes.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the need for better code readability and debugging experience
- Thanks to the VS Code team for their extensible editor & excellent extension API
- Thanks to all contributors who have helped improve this extension
Support
If you find this extension helpful, please consider:
- Sharing the extension
- Starring the repository
- Reporting bugs
- Suggesting new features