BugSpotter - AI-Powered Python Bug Detection and Fixing
BugSpotter is a Visual Studio Code extension that helps Python developers by automatically detecting bugs and providing one-click fixes. It combines pattern-based fixes with AI-powered solutions to make debugging faster and easier.
Features
🔍 Real-time Bug Detection
Analyzes your Python code as you type
Shows errors and warnings with helpful descriptions
Highlights problematic code with squiggly underlines
🛠️ Smart Bug Fixing
BugSpotter offers three levels of bug fixing:
Pattern-based fixes (fastest)
Uses a database of known bugs and their solutions
Works offline and is extremely fast
Gets smarter over time as it learns from your fixes
AI-powered fixes (most capable)
Uses Gemini AI to fix complex issues
Can handle bugs that have never been seen before
Generates complete, contextual fixes for your code
Basic fixes (fallback)
Simple rule-based corrections for common syntax errors
Always available even without internet or API key
📊 Pattern Analytics
View statistics about your pattern database
See which bug types are most common in your code
Track the growth and effectiveness of the pattern matching
Getting Started
Installation
Install the extension from the VS Code marketplace
No additional setup required for basic functionality
AI Features Setup (Optional)
Create a .env file in your project root
Add your Gemini API key: GEMINI_API_KEY=your_key_here
Usage
Open any Python file - bug detection starts automatically
Click "Fix All Bugs" to automatically fix all detected issues
Use "Fix Current Line" to fix only the current issue
View pattern stats to see analytics about your fixes
Commands
BugSpotter: Check for Bugs - Manually analyze the current file
BugSpotter: Fix All Bugs with AI - Automatically fix all detected bugs
BugSpotter: Fix Current Line - Fix only the bug on the current line
BugSpotter: View Pattern Statistics - Open pattern analytics dashboard
Settings
bugspotter.pythonPath - Path to Python executable
bugspotter.lintOnSave - Enable/disable analysis on save
bugspotter.lintOnType - Enable/disable analysis while typing
bugspotter.lintOnTypeDelay - Delay before analyzing after typing
bugspotter.notificationCooldownPeriod - Time between notifications
bugspotter.preferredFixMethod - Set your preferred fixing method
bugspotter.showFixMethodInNotification - Show which method was used for fixing
How It Works
BugSpotter uses a multi-layered approach for fixing bugs:
First, it tries to match the bug against its pattern database
If no pattern matches, it uses Gemini AI to generate a fix (if configured)
As a last resort, it applies basic syntax fixes
Each time the AI successfully fixes a bug, the fix is added to the pattern database so it can be applied instantly next time the same bug is encountered.