VS Code Extension for exploring and navigating all comments in the project through a tree view in the side panel.

⚡ High Performance: Optimized scanning with comprehensive exclusion rules to skip node_modules, build outputs, and cache directories for fast operation.
Features
Collect all types of comments from project files:
- Single line comments (
//
, #
, --
)
- Multiline comments (
/* */
, <!-- -->
, {# #}
)
- Support for all popular programming languages
High performance scanning with comprehensive exclusion rules
Customizable file extensions through VS Code settings
Customizable regular expressions for finding comments
Flexible exclusion rules for files and folders (excludes node_modules, build dirs, caches by default)
Tree view with grouping by files
Click on a comment opens the file on the desired line
Detailed tips with information about the file and position
Update command for re-scanning
Debug command to test exclusion rules
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Comment Tree"
- Click Install
From VSIX File
- Download
comment-tree-x.x.x.vsix
from the Releases section
- Open VS Code
- Open Command Palette (Ctrl+Shift+P)
- Type "Extensions: Install from VSIX"
- Select the downloaded
.vsix
file
- Click Install
Usage
- Open the workspace with the project
- In the side panel find the "Comments" section
- Expand the files to view the found comments
- Click on a comment to navigate to it in the code
- Use the update button to re-scan comments
- Use the "Test Exclusions" command to verify that exclusions are working correctly
Settings
The extension provides the following settings in settings.json
:
Regular expression for finding comments (default: //.*|/\\*[\\s\\S]*?\\*/|<!--[\\s\\S]*?-->
)
Array of file extensions to include in scanning (default includes popular languages)
Array of exclusion patterns for files and folders. By default, excludes common directories and files that don't contain user comments:
**/node_modules/**
- Node.js dependencies
**/dist/**
, **/build/**
, **/out/**
- Build outputs
**/.git/**
, **/.vscode/**
- Version control and IDE files
**/.next/**
, **/.nuxt/**
, **/.cache/**
- Framework caches
**/coverage/**
, **/*.min.js
, **/*.map
- Generated/test files
Example settings:
{
"commentExplorer.regex": "//.*|#.*|--.*|/\\*[\\s\\S]*?\\*/",
"commentExplorer.fileExtensions": ["js", "ts", "py", "java"],
"commentExplorer.exclude": ["**/node_modules/**", "**/dist/**", "**/.git/**"]
}
Commands
The extension provides the following commands:
- Comment Tree: Refresh - Re-scan all comments in the workspace
- Comment Tree: Test Exclusions (Debug) - Test that exclusion rules are working correctly
Project structure
src/extension.ts
- Entry point of the extension
src/commentTreeProvider.ts
- Data provider for the comment tree
src/commentItem.ts
- Class for representing comments in the tree
Development
Requirements
Building
npm install
npm run compile
# Format all files
npm run format
# Check formatting without changes
npm run format-check
Running in development mode
npm run watch
Testing
npm run test
Known Limitations
- Maximum 10000 files are scanned at once for performance
- Some complex regular expressions may work slowly
- Large files may affect performance
- Comments in binary files are not supported
License
MIT License
Support
If you found a bug or want to suggest an improvement, please create an issue in the project repository.