A powerful Visual Studio Code extension for Python static type checking and intelligent error fixing
For detailed Documentation, click here
PyTypeWizard is a comprehensive VS Code extension that integrates Pyre static type checker with advanced Large Language Models (LLMs) to automatically detect and fix Python type errors with intelligent suggestions.
- 🎯 Real-time Type Checking: Integrated Pyre static analysis for immediate error detection
- 🤖 AI-Powered Fixes: LLM integration (Gemini/OpenAI) for intelligent type error resolution
- 📋 Interactive Dashboard: Comprehensive sidebar with error history and management
- 🔍 Smart Code Analysis: Advanced code chunking and context-aware suggestions
- ⚡ CodeLens Integration: Quick fixes directly in the editor with one-click application
- 🛠️ Configurable Settings: Customizable error types and LLM provider selection
- 📊 Solution History: Track and review past fixes and improvements
- VS Code (version 1.96.0 or higher)
- Python (version 3.6 or higher)
- Node.js (version 14 or higher)
-
Install Dependencies:
cd vscode-extension-v2 npm install
-
Build the Extension:
npm run compile
-
Launch Development Mode:
- Press
F5
in VS Code - Or use
Run > Start Debugging
- Extension Development Host window will open
- Press
# Install packaging tool
npm install -g @vscode/vsce
# Create .vsix package
vsce package
# Install via VS Code Command Palette
# Extensions: Install from VSIX
- Open a Python Project in the Extension Development Host
- Configure API Key in VS Code Settings (
pytypewizard.ApiKey
) - Select LLM Provider (Gemini or OpenAI)
- Open Python Files with type errors
- Automatic Detection: Type errors appear in Problems panel
- Quick Fixes: Click lightbulb icons or use CodeLens
- Sidebar Dashboard: Access comprehensive error management
- Code Selection: Select code snippets for targeted analysis
PyTypeWizard: Show History
- View solution historyPyTypeWizard: Open Settings
- Configure extension preferencesPyTypeWizard: Chunk Documents
- Index project for better contextPyTypeWizard: Clear Context
- Reset cached data
Configure the extension through VS Code Settings:
{
"pytypewizard.enableCodeLens": true,
"pytypewizard.llmProvider": "gemini",
"pytypewizard.ApiKey": "your-api-key-here",
"pytypewizard.enabledErrorTypes": [
"Incompatible variable type",
"Incompatible parameter type",
"Incompatible return type",
"Invalid type",
"Unbound name",
"Incompatible attribute type"
]
}
- Core Engine: Main extension logic and Pyre integration
- LLM Integration: AI-powered suggestion generation
- Database Layer: SQLite storage for chunks and solutions
- GUI Framework: Svelte-based interactive sidebar
- Code Analysis: Advanced Python AST parsing and context extraction
- Incompatible variable types
- Parameter type mismatches
- Return type inconsistencies
- Invalid type annotations
- Unbound variable references
- Attribute type conflicts
- Enhanced multi-file type analysis
- Batch error processing capabilities
- Integration with additional static analyzers
- Advanced refactoring suggestions
- Team collaboration features
- Performance optimization for large codebases
- Execution Guide - Detailed setup and usage instructions
- Package Configuration - Extension manifest and dependencies
- Changelog - Version history and updates
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Implement your changes
- Test thoroughly with the development setup
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE.md file for details.