Skip to main content

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 analysis
  • X-Fidelity: Debug Analysis with --dir - Debug with explicit workspace path
  • X-Fidelity: Control Center - Open main control panel
  • X-Fidelity: Open Settings - Configure extension settings
  • X-Fidelity: Show Output Channel - View debug logs
  • X-Fidelity: Show WASM Status - Check WASM initialization status
  • X-Fidelity: Show Performance Report - View performance metrics
  • X-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

  1. Open Project: Open your project in VSCode
  2. Find Extension: Click the X-Fidelity icon in the activity bar
  3. Configure: Set your archetype and configuration server in settings
  4. Run Analysis: Use Ctrl+Shift+PX-Fidelity: Run Analysis Now
  5. Review Results: Check the Issues tree view and Problems panel
  6. 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:

  1. Run X-Fidelity: Show Performance Report
  2. Identify slow operations or high memory usage
  3. Adjust timeout settings or exclude patterns as needed
  4. Monitor WASM status for AST analysis optimization

Custom Configurations

Set up project-specific configurations:

  1. Create .xfi-config.json in project root
  2. Configure exemptions and additional plugins
  3. Set workspace-specific VSCode settings
  4. 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