Ensure you have the following installed:
- Node.js (v14+): Download from nodejs.org
- VS Code (v1.96.0+): Download from code.visualstudio.com
- Python (v3.6+): Download from python.org
# Navigate to the extension directory
cd /home/fahad/Documents/PROJECTS/PyTypeWizard/vscode-extension-v2
# Install all npm dependencies
npm install
# Verify installation
ls node_modules # Should show installed packages# Option A: One-time build
npm run compile
# Option B: Watch mode (recommended for development)
npm run watchBuild Output Verification:
- Check that
dist/folder is created - Check that
out/folder contains compiled TypeScript - Verify no compilation errors in terminal
-
Open project in VS Code:
code /home/fahad/Documents/PROJECTS/PyTypeWizard/vscode-extension-v2
-
Launch Extension Development Host:
- Press
F5key, OR - Use menu:
Run > Start Debugging, OR - Open Command Palette (
Ctrl+Shift+P) → "Debug: Start Debugging"
- Press
-
A new VS Code window opens titled "Extension Development Host"
-
In the new window, test the extension:
- Open a Python project
- Create/open a Python file with type errors
- Observe extension functionality
- Open Command Palette:
Ctrl+Shift+P - Type: "Developer: Reload Window"
- Extension reloads in current window
- Open Run and Debug view:
Ctrl+Shift+D - Select "Run Extension" from dropdown
- Click green play button (
▶️ )
- Look for "PyTypeWizard" in the activity bar
- Check if sidebar shows PyTypeWizard panel
- Verify commands in Command Palette (
Ctrl+Shift+P→ type "PyTypeWizard")
- Error Detection: Open Python file with type errors
- Problems Panel: View errors in VS Code Problems panel
- CodeLens: Look for clickable hints above code
- Quick Fixes: Click lightbulb icons for suggested fixes
- Sidebar: Access PyTypeWizard panel for history and settings
- Open VS Code Settings:
Ctrl+, - Search for "PyTypeWizard"
- Configure:
pytypewizard.ApiKey: Your API keypytypewizard.llmProvider: "gemini" or "openai"pytypewizard.enableCodeLens: true/false
{
"pytypewizard.ApiKey": "your-api-key-here",
"pytypewizard.llmProvider": "gemini",
"pytypewizard.enableCodeLens": true,
"pytypewizard.enabledErrorTypes": [
"Incompatible variable type",
"Incompatible parameter type",
"Incompatible return type"
]
}Create a test file test_errors.py:
def add_numbers(a: int, b: int) -> int:
return a + b
# This should trigger type errors
result = add_numbers("hello", "world") # String instead of int
x: int = "not a number" # Type mismatchExpected behavior:
- Errors appear in Problems panel
- CodeLens appears above functions
- Quick fixes available via lightbulb
- Sidebar shows error details
# Install VS Code Extension Manager
npm install -g @vscode/vsce
# Package the extension
vsce package
# Install the generated .vsix file
# In VS Code: Ctrl+Shift+P → "Extensions: Install from VSIX"# Clear and rebuild
rm -rf node_modules dist out
npm install
npm run compile- Check VS Code version compatibility (1.96.0+)
- Verify all dependencies installed:
npm ls - Check for TypeScript errors:
npx tsc -p ./
- Ensure Python extension is installed in VS Code
- Verify Python interpreter is selected
- Install Pyre:
pip install pyre-check
- Verify API key is set in settings
- Check internet connection
- Ensure LLM provider is correctly configured
To view extension logs:
- Open Output panel:
View > Output - Select "PyTypeWizard" from dropdown
- Monitor for error messages
- Use
npm run watchduring development - Keep Extension Development Host window open
- Reload only when necessary
- Start watch mode:
npm run watch - Launch Extension Development Host:
F5 - Make code changes
- Reload Extension Host:
Ctrl+Rin Extension Development Host window - Test changes
- Repeat steps 3-5
vscode-extension-v2/
├── src/ # TypeScript source code
├── gui/ # Svelte components
├── media/ # Icons and assets
├── dist/ # Webpack output
├── out/ # TypeScript output
├── package.json # Extension manifest
└── tsconfig.json # TypeScript configuration
This guide provides comprehensive steps to execute and test the PyTypeWizard VS Code extension.