VSCode Extension Features
The X-Fidelity VSCode extension provides a comprehensive suite of features that transform the command-line analysis tool into a fully-integrated development experience.
Core Features
1. Real-time Analysis
- Auto-analysis on Save: Automatic code analysis when files are saved
- Progress Tracking: Real-time progress indicators during analysis
- Background Processing: Non-blocking analysis execution
- Cancellation Support: Ability to cancel long-running analyses
2. Professional User Interface
Activity Bar Integration
- Dedicated Sidebar: X-Fidelity icon in the VSCode activity bar
- Organized Views: Multiple tree views for different aspects of analysis
- Quick Actions: Common operations accessible with one click
- Status Indicators: Real-time status updates and notifications
Issues Tree View
Issues are displayed in an organized tree structure with multiple grouping options:
- By Severity: Critical, High, Medium, Low
- By Rule: Group issues by the rule that triggered them
- By File: Organize issues by file location
- By Category: Group by analysis category or plugin
Control Center
Centralized access to all X-Fidelity functionality:
- Analysis Controls: Start, stop, and configure analysis
- Settings Access: Quick access to extension configuration
- Report Management: View and manage analysis reports
- Performance Monitoring: Access to performance metrics and statistics
3. Native VSCode Integration
Diagnostics Integration
- Problems Panel: Issues appear in VSCode's native Problems panel
- Inline Decorations: Issues highlighted directly in code editors
- Severity Mapping: Proper mapping of X-Fidelity severities to VSCode diagnostic levels
- Quick Fixes: Where applicable, suggested fixes for issues
Command Palette
All features accessible through VSCode's command palette:
X-Fidelity: Run Analysis Now
- Standard analysisX-Fidelity: Debug Analysis with --dir
- Debug with explicit workspace pathX-Fidelity: Control Center
- Open main control panelX-Fidelity: Open Settings
- Configure extension settingsX-Fidelity: Show Output Channel
- View debug logsX-Fidelity: Show WASM Status
- Check WASM initialization statusX-Fidelity: Show Performance Report
- View performance metricsX-Fidelity: Worker Statistics
- Display worker thread statistics
4. Advanced Configuration
Settings Integration
Comprehensive configuration through VSCode settings:
{
"xfidelity.archetype": "node-fullstack",
"xfidelity.autoAnalyzeOnSave": true,
"xfidelity.configServer": "http://localhost:8888",
"xfidelity.openaiEnabled": false,
"xfidelity.reportOutputDir": ".xfiResults",
"xfidelity.logLevel": "info",
"xfidelity.maxFileSize": 1048576,
"xfidelity.analysisTimeout": 30000,
"xfidelity.excludePatterns": ["**/node_modules/**", "**/dist/**"]
}
Workspace Support
- Multi-workspace: Support for VSCode multi-root workspaces
- Monorepo Aware: Intelligent handling of monorepo structures
- Project-specific Config: Support for
.xfi-config.json
files - Workspace Settings: Workspace-level configuration overrides
5. Performance & Monitoring
Built-in Performance Monitoring
- Operation Timing: Track timing of all analysis operations
- Memory Usage: Monitor memory consumption during analysis
- WASM Performance: Specialized monitoring for WASM Tree-sitter operations
- Worker Thread Stats: Statistics for background processing
Performance Reports
Detailed performance insights accessible through commands:
- Analysis Duration: Time taken for complete analysis cycles
- Plugin Performance: Individual plugin execution times
- File Processing: Per-file analysis metrics
- Memory Tracking: Memory usage patterns and optimization opportunities
6. Enhanced Debugging
Comprehensive Logging
- Multiple Log Levels: Trace, Debug, Info, Warn, Error, Fatal
- Structured Logging: JSON-formatted logs with context
- Performance Logs: Detailed timing and performance data
- Error Tracking: Comprehensive error reporting and stack traces
Debug Output Channels
- X-Fidelity Debug: Main debug output channel
- Performance Metrics: Dedicated channel for performance data
- WASM Diagnostics: WASM Tree-sitter specific debugging information
7. Advanced Analysis Features
AST Analysis
- Tree-sitter Integration: Advanced AST parsing capabilities
- Multi-language Support: JavaScript, TypeScript, and extensible to other languages
- Pattern Matching: Sophisticated code pattern detection
- Fallback Mechanisms: Graceful degradation when WASM is unavailable
Plugin System Integration
Full access to all X-Fidelity plugins:
- AST Plugin (
xfiPluginAst
): Advanced syntax tree analysis - Dependency Plugin (
xfiPluginDependency
): Package dependency validation - Filesystem Plugin (
xfiPluginFilesystem
): File structure analysis - OpenAI Plugin (
xfiPluginOpenAI
): AI-powered analysis (when configured) - React Patterns Plugin (
xfiPluginReactPatterns
): React-specific pattern detection - Remote Validator Plugin (
xfiPluginRemoteStringValidator
): External validation
8. Report Management
Analysis Reports
- JSON Reports: Machine-readable analysis results
- Markdown Reports: Human-readable summaries
- Historical Data: Track analysis results over time
- Export Capabilities: Export reports in various formats
Result Storage
- Dedicated Directory: Results stored in
.xfiResults/
directory - Timestamped Files: Automatic timestamping of all reports
- Cleanup Management: Automatic cleanup of old reports
- Workspace Isolation: Results isolated per workspace
Usage Examples
Basic Workflow
- Open Project: Open your project in VSCode
- Find Extension: Click the X-Fidelity icon in the activity bar
- Configure: Set your archetype and configuration server in settings
- Run Analysis: Use
Ctrl+Shift+P
→X-Fidelity: Run Analysis Now
- Review Results: Check the Issues tree view and Problems panel
- Navigate: Click on issues to jump to relevant code locations
Advanced Workflows
Continuous Monitoring
Enable auto-analysis for continuous code quality monitoring:
{
"xfidelity.autoAnalyzeOnSave": true,
"xfidelity.analysisTimeout": 30000
}
Performance Optimization
Monitor and optimize analysis performance:
- Run
X-Fidelity: Show Performance Report
- Identify slow operations or high memory usage
- Adjust timeout settings or exclude patterns as needed
- Monitor WASM status for AST analysis optimization
Custom Configurations
Set up project-specific configurations:
- Create
.xfi-config.json
in project root - Configure exemptions and additional plugins
- Set workspace-specific VSCode settings
- Use remote configuration servers for team consistency
Troubleshooting Features
Performance Issues
- Timeout Settings: Adjust analysis timeout for large codebases
- Exclude Patterns: Skip irrelevant files and directories
- Memory Monitoring: Track memory usage and optimize accordingly
Analysis Failures
- Fallback Mechanisms: Graceful degradation when components fail
- Error Reporting: Detailed error messages and stack traces
- Debug Channels: Multiple output channels for different types of information
Configuration Problems
- Settings Validation: Real-time validation of configuration settings
- Config Server Testing: Built-in testing of remote configuration connections
- Plugin Loading: Detailed logging of plugin loading and initialization
Next Steps
- Development Guide - Contributing to extension development
- Configuration Guide - Advanced configuration options
- Plugin Development - Creating custom plugins