Task Lens
TaskLens is a powerful and intuitive VS Code extension designed to revolutionize how you manage your code comments and tasks. It automatically scans your workspace for TODO, FIXME, BUG, and other important comment tags, presenting them in an organized, clickable tree view with advanced filtering and grouping capabilities.
🚀 Features
📊 Task Detection & Management
- Smart Comment Detection: Automatically finds TODO, FIXME, BUG, HACK, NOTE, WARNING, and custom tags
- Real-time Updates: Instantly detects new tasks as you type
- Multi-language Support: Works with TypeScript, JavaScript, Python, Java, C++, and more
- Custom Tags: Add your own task tags via configuration
- Rate Limiting: Prevents excessive operations and DoS attacks
- File Size Limits: Protects against large file processing issues
- Workspace Boundaries: Ensures files are only scanned within your project
- Memory Optimization: Efficient handling of large projects with automatic cleanup
- Caching System: Fast performance with intelligent caching (5-minute expiry)
📈 Statistics & Analytics
- Comprehensive Statistics: View total tasks, files, and averages
- Tag Distribution: See which task types are most common
- File Analysis: Identify files with the most tasks
- Time-based Analysis: Track task creation patterns
- Incremental Scanning: Only scans changed files for faster performance
- Background Processing: Non-blocking scans with progress indicators
- Memory Management: Automatic cleanup for large projects
- Smart Caching: Reduces scan time by 70-80%
📦 Installation
From VSIX Package
- Download the latest
task-lens-*.vsix
file from the releases
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click the "..." menu and select "Install from VSIX..."
- Select the downloaded .vsix file
- Restart VS Code
Note: Always download the latest version for the newest features and security updates.
🎯 Usage
Getting Started
- Open VS Code with a workspace containing code files
- The Task Lens view will automatically appear in the Explorer sidebar
- Your workspace will be automatically scanned for comment tags
- Click on any task item to navigate to the specific file and line
- Hover over tasks to see creation date and time information
The extension recognizes comments in the following formats:
// TODO: Implement this feature
// FIXME: This needs to be fixed
// BUG: There's a bug here
// NOTE: Important note about this code
// HACK: Temporary workaround for the issue
// WARNING: Be careful with this implementation
// OPTIMIZE: This could be optimized for better performance
// REVIEW: Needs code review before merging
// XXX: Something to investigate further
// REFACTOR: Code needs to be refactored
// CHORE: Routine maintenance task
// WIP: Work in progress
// DEPRECATED: This code will be removed
// BLOCKED: Task is blocked by external dependency
You can define your own project-specific tags in addition to the default ones. Task Lens supports two methods for adding custom tags:
Method 1: Project Configuration File (Recommended)
Create a .task-lens-config.json
file in your project root:
{
"customTags": [
"FEATURE",
"UI",
"API",
"DB",
"SECURITY",
"PERFORMANCE",
"TEST",
"DOCS"
]
}
Advantages:
- Project-specific configuration
- Version controlled with your code
- Shared with team members
- Works across different VS Code instances
Method 2: VS Code Settings
Add custom tags to your VS Code settings:
{
"task-lens.customTags": [
"FEATURE",
"UI",
"API",
"DB",
"SECURITY",
"PERFORMANCE"
]
}
Advantages:
- Global configuration
- Personal preferences
- Works across all projects
- Custom tags are dynamically loaded when Task Lens scans your workspace
- Both methods can be used simultaneously - tags are merged automatically
- Duplicate tags are automatically removed
- Changes to custom tags require a refresh of Task Lens
Usage Examples
// FEATURE: Yeni ödeme sistemi ekle
// UI: Header tasarımını güncelle
// API: User endpoint'i ekle
// DB: Yeni tablo oluştur
// SECURITY: Password validation ekle
// PERFORMANCE: Cache sistemi kur
// TEST: Unit testler yaz
// DOCS: API dokümantasyonu güncelle
// You can also use them in different languages:
// FEATURE: Add new payment system
// UI: Update header design
// API: Add user endpoint
// DB: Create new table
// SECURITY: Add password validation
// PERFORMANCE: Setup cache system
// TEST: Write unit tests
// DOCS: Update API documentation
Custom tags work with all supported comment formats:
// FEATURE: Single line comment
/* FEATURE: Block comment style */
# FEATURE: Python style comment
# FEATURE: Ruby style comment
Supported File Types
- TypeScript (.ts, .tsx)
- JavaScript (.js, .jsx)
- Python (.py)
- Java (.java)
- C++ (.cpp, .c)
- C# (.cs)
- PHP (.php)
- Ruby (.rb)
- Go (.go)
- Rust (.rs)
- Swift (.swift)
- Kotlin (.kt)
- Scala (.scala)
- Vue (.vue)
🔍 Filtering and Search
Filter by Tag
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Filter by Tag"
- Select a tag from the list (TODO, FIXME, BUG, etc.)
- The view will show only tasks with the selected tag
Filter by File
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Filter by File"
- Select a file from the list
- The view will show only tasks from the selected file
Search in Tasks
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Search Tasks"
- Enter your search text
- The view will show tasks containing the search text in the message, tag, or filename
Clear Search
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Clear Search"
- Search will be cleared and all tasks will be shown
Clear Filters
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Clear Filter"
- All filters will be cleared and all tasks will be shown
Clear Grouping
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Clear Grouping"
- Grouping will be disabled and tasks will be shown in flat list
📊 Grouping and Organization
Enable Grouping
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Toggle Grouping"
- Tasks will be grouped by tag (default) or file
Change Grouping Type
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Change Grouping Type"
- Select "Group by Tag" or "Group by File"
View Grouped Tasks
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Show Grouped Tasks"
- Select a group to view its tasks
Check Grouping Status
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Show Grouping Status"
- View current grouping settings and task count
📈 Statistics and Analytics
View Comprehensive Statistics
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Show Statistics"
- Modern webview panel opens with detailed analytics
View Tag Distribution
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Show Tag Distribution"
- See detailed breakdown of task tags
View File Statistics
- Open Command Palette (Ctrl+Shift+P)
- Type "Task Lens: Show File Statistics"
- View top files with highest task density
Built-in Protection
Task Lens includes comprehensive security and performance features to ensure safe and efficient operation:
Workspace Protection
- Boundary Enforcement: Scanning stays within your project limits
- File Size Limits: Automatically handles large files efficiently (max 10MB)
- Content Limits: Processes large text files safely (max 1MB content)
- Path Security: Prevents access to files outside workspace
- Incremental Scanning: Only scans changed files for 90%+ faster performance
- Smart Caching: Caches results for 70-80% performance boost
- Memory Management: Efficient handling of large workspaces
- Background Processing: Non-blocking operations
Data Security
- Config Encryption: Custom tags are stored securely
- Event Logging: Security events are tracked and monitored
- Error Recovery: Graceful handling of file access issues
- Rate Limiting: Prevents excessive resource usage
Status Commands
Task Lens: Show Cache Status
- View cache performance and status
Task Lens: Show Performance Status
- View incremental scanning status
Task Lens: Show Security Events
- View security events and logs
Task Lens: Encrypt Config
- Encrypt custom tags configuration
Task Lens: Clear Cache
- Clear cached data for fresh scan
⚙️ Customization
Task Lens shows notifications when refreshing tasks. If you want to change the position of these notifications:
- Open VS Code Settings (Ctrl+,)
- Search for "notifications"
- Modify these settings:
"notifications.position"
: Set to "top-right" for right-side notifications
"notifications.showInStatusBar"
: Enable for status bar notifications
"notifications.showInCenter"
: Enable for center notifications
Alternatively, you can add these settings to your settings.json
:
{
"notifications.position": "top-right",
"notifications.showInStatusBar": false
}
📋 Commands
Core Commands
- Task Lens: Refresh - Manually refresh task detection
- Task Lens: Show Statistics - View comprehensive task analytics
- Task Lens: Show Tag Distribution - See task type breakdown
- Task Lens: Show File Statistics - Analyze files with most tasks
- Task Lens: Show Cache Status - Check caching performance
- Task Lens: Show Performance Status - View incremental scanning status
- Task Lens: Clear Cache - Clear cached data
- Task Lens: Test Memory Optimization - Check memory usage and optimization status
Background Processing
- Task Lens: Test Background Processing - Test background scanning capabilities
🔍 Troubleshooting
- Slow scanning: Try "Clear Cache" command to refresh data
- High memory usage: Use "Test Memory Optimization" to check memory status
- Large projects: The extension automatically optimizes for projects with many files
Common Issues
- Tasks not appearing: Ensure your comments use supported tags (TODO, FIXME, etc.)
- Files not scanned: Check if files are within workspace boundaries
- Security warnings: These are normal for large files or rapid operations
Memory Optimization
The extension includes automatic memory management for large projects:
- Automatic cleanup: Memory is cleaned up when usage is high
- Chunk-based loading: Large task lists are loaded in smaller chunks
- Cache management: Intelligent caching with automatic expiry
- Background processing: Non-blocking operations to prevent UI freezing
Task Lens includes built-in limits to ensure optimal performance:
- Maximum Files: 10,000 files per workspace
- Maximum Tasks: 5,000 tasks total
- Maximum File Size: 10MB per file
- Maximum Content: 1MB text content per file
- Maximum Line Length: 10,000 characters per line
- Maximum Message Length: 500 characters per task message
- Refresh Rate: Minimum 2 seconds between refreshes
Excluded Directories
The following directories are automatically excluded from scanning:
node_modules/
.git/
- Any directory starting with
.
(hidden directories)
Enjoy using Task Lens to manage your code tasks more efficiently! 🎉