CommentGlow 🌟Intelligent, high-performance comment marker highlighting & interactive Comment Explorer for Visual Studio Code. Why CommentGlow • Supported Markers • Languages • Comment Explorer • Configuration • Security Policy • Performance • Testing OverviewIn enterprise codebases, critical comments blur into the background. Open questions, technical debt, urgent bugs, and security requirements get buried in thousands of lines of code. CommentGlow transforms passive comments into active, visually differentiated cues. It provides line-by-line precision highlighting across single-line and multiline comments, safe hover tooltips, and an interactive Comment Explorer Activity Bar view with instant global search and category filtering—all running on pure native JavaScript with zero external runtime dependencies. Key Features
Supported MarkersCommentGlow comes pre-configured with curated, developer-focused markers:
Supported Languages & SyntaxCommentGlow includes optimized lexical analyzers for all mainstream syntax formats: 1. Line Comments (
|
| Style | Comment Delimiters | Primary Languages |
|---|---|---|
| C-Style | //, /* ... */ |
JavaScript, TypeScript, JSX, TSX, C, C++, C#, Java, Go, Rust, PHP, Kotlin, Swift, Scala, Dart, CSS, SCSS, LESS, JSONC |
| Hash-Style | # |
Python, Shell, Bash, Ruby, YAML, Dockerfile, Perl, R, PowerShell, Makefile, TOML, INI |
| Dash-Style | -- |
SQL, Lua, Haskell, Ada |
| HTML-Style | <!-- ... --> |
HTML, XML, Markdown, Vue, Svelte, SVG |
5. JSDoc Intelligence
Standard JSDoc comments (/** ... */) receive specialized handling. Structural asterisks (such as continuation lines on @param, @returns, and descriptions) are never falsely classified as * (IMPORTANT) markers. However, genuine markers inside JSDoc (e.g. * TODO: add validation) are still highlighted accurately.
Comment Explorer & Interactive Features
1. Activity Bar Comment Explorer
Open the dedicated Comment Explorer in the VS Code Activity Bar (Ctrl+Shift+E / Cmd+Shift+E or via command palette) to inspect all active markers across open files:
COMMENT EXPLORER
├── 🟡 TODO (14)
│ ├── auth.js:42 — Implement refresh token rotation
│ ├── api.js:89 — Add cursor-based pagination
│ └── payment.js:154 — Support multi-currency checkout
├── 🔴 CRITICAL (3)
│ ├── security.js:18 — Validate HMAC signature prior to dispatch
│ └── crypto.js:94 — Prevent storing private keys in RAM
├── 🔴 FIXME (5)
├── 🔵 QUESTION (8)
├── 🟣 IMPORTANT (6)
└── 🟠 REFACTOR (4)
Clicking any comment item instantly focuses the document and navigates your cursor directly to the target line and column.
2. Hover Tooltips
Hover over any highlighted marker in the editor to inspect an inert, secure tooltip displaying marker identity, category, and description.
3. Command Palette Quick Actions
Access CommentGlow features quickly using Ctrl+Shift+P / Cmd+Shift+P:
| Command | Title | Action |
|---|---|---|
commentglow.openExplorer |
CommentGlow: Open Comment Explorer | Focuses the Activity Bar Comment Explorer |
commentglow.refresh |
CommentGlow: Refresh Comments | Forces an immediate scan and decoration re-render |
commentglow.showAll |
CommentGlow: Show All Comments | Resets active filters and displays all markers |
commentglow.showTodos |
CommentGlow: Show TODOs | Filters the Explorer tree view exclusively to TODO items |
commentglow.showFixmes |
CommentGlow: Show FIXMEs | Filters the Explorer tree view exclusively to FIXME items |
commentglow.showCritical |
CommentGlow: Show Critical Comments | Filters the Explorer tree view to CRITICAL items |
commentglow.search |
CommentGlow: Search Comments... | Searches all comments across files by text query |
commentglow.filter |
CommentGlow: Filter Comments... | Opens a QuickPick menu to select an active category filter |
Configuration
Customize CommentGlow by modifying your VS Code settings.json:
{
"commentglow.enable": true,
"commentglow.disabledMarkers": [
"QUESTION"
],
"commentglow.markers": [
{
"name": "TODO",
"color": "#eab308"
},
{
"name": "BUG",
"token": "BUG",
"type": "word",
"color": "#ef4444",
"fontWeight": "bold",
"description": "Known bug or defect",
"category": "bug"
},
{
"name": "AUDIT",
"token": "@",
"type": "symbol",
"color": "#10b981",
"fontWeight": "bold",
"description": "Security audit required",
"category": "critical"
}
]
}
Settings Reference
| Setting | Type | Default | Description |
|---|---|---|---|
commentglow.enable |
boolean |
true |
Globally enable or disable comment highlighting and indexing. |
commentglow.disabledMarkers |
string[] |
[] |
Array of marker names or tokens to disable (e.g. ["QUESTION", "#"]). |
commentglow.markers |
object[] |
[] |
Custom marker configurations or overrides for default markers. |
Marker Object Schema
name(string, required): Unique identifier for the marker (e.g."AUDIT").token(string, required): String or character to match (max 50 chars).type(string, required):"word"for word boundaries or"symbol"for character prefixes.color(string, required): Hex (#rrggbb), RGB/RGBA, HSL, or named CSS color. Malicious or invalid CSS values safely fall back to#d3c935.fontWeight(string, optional):"normal","bold", or standard numeric weight (100-900). Default:"bold".description(string, optional): Tooltip description displayed on hover. Max 200 chars.category(string, optional): Grouping identifier in Comment Explorer (task,bug,critical,question,important,refactor, or custom).enabled(boolean, optional): Whether this marker is actively highlighted. Default:true.
Security & Hardening
CommentGlow adheres to a strict zero-trust threat model designed for untrusted repositories and malicious workspace configurations.
Complete details are documented in our Security Policy & Architecture Document (SECURITY.md).
Core Security Guarantees
- Zero Network Egress: CommentGlow performs zero outbound HTTP/HTTPS or socket connections. No telemetries, no third-party APIs.
- Zero Process Execution: Never spawns child processes, shell commands, or external binaries.
- Inert Hover Cards (VULN-01): Tooltips strictly enforce
isTrusted = falseandsupportHtml = false. Command injection URIs and raw HTML tags are sanitized and neutralized. - ReDoS & Token Defense (VULN-02): Tokens are bounded to
<= 50characters. Regular expressions use safe string escaping (escapeRegExp). Linear HTML scanners prevent catastrophic regex backtracking (WEAK-01). - Memory Bloat Defense (WEAK-02): Comment previews are capped at
<= 303characters, and raw text is capped at<= 5003characters to prevent heap exhaustion. - Prototype Pollution Immunity: Custom marker merge logic explicitly rejects
__proto__,constructor, andprototypekeys. - Strict CSS Sanitization (WEAK-05): Colors and font weights are validated against strict whitelists before injection into editor decoration types.
Run the automated 20-scenario security test suite:
npm run test:security
Performance & Benchmarks
CommentGlow is engineered for near-instant execution in massive monorepos:
- 10,000 Comments Parsed: Completed in < 40ms without heap degradation.
- 1.9MB Single Document Scan: Completed in < 60ms.
- Oversized Document Protection: Files exceeding 2MB are automatically bypassed to protect the VS Code Extension Host thread.
- Per-URI Debouncing: Edits are debounced at 100ms per active document URI, ensuring zero keystroke lag during rapid typing.
Testing & Quality Assurance
The extension maintains comprehensive automated test coverage validated via Node.js's native test runner:
# Run all test suites (50 total test scenarios)
npm run test:all
# Run the 20-scenario security & hardening regression suite
npm run test:security
# Run the 30-scenario functional parser & index suite
npm run test:unit
# Run static analysis and ESLint verification
npm run lint
Contributing & Development
We welcome contributions! To set up CommentGlow locally:
- Clone the repository:
git clone https://github.com/ansh35/CommentGlow.git cd commentglow - Install development dependencies:
npm install - Launch Extension Development Host:
- Open the project in VS Code.
- Press
F5(or run Run > Start Debugging). - A new Extension Development Host window will launch with CommentGlow loaded.
- Test Live Markers:
- Open
demo.jsordemo.pyin the Host window to test markers live in real time.
- Open
- Verify Tests:
- Run
npm run test:allbefore submitting pull requests.
- Run
License
This project is licensed under the MIT License.