Python Debug Variables
A powerful VS Code extension for inspecting Python variables during debugging sessions with an intuitive sidebar interface.
Features
🔍 Real-time Variable Inspector
- Displays all user-defined variables in a clean, organized table view
- Shows variable name, type, shape (for arrays/lists), and value preview
- Automatically updates when execution stops at breakpoints or after REPL commands
📊 Smart Filtering
- Filters out internal Python variables (those starting with
_ or __)
- Excludes functions, modules, classes, and methods
- Shows only data variables relevant to your debugging workflow
⚡ Automatic Updates
- Auto-refreshes variable list when:
- Program hits a breakpoint
- Stepping through code (step over, step into, step out)
- Executing commands in the Debug Console
📋 Comprehensive Variable Information
- Variable Name: Alphabetically sorted for easy lookup
- Type: Python type (int, str, list, numpy.ndarray, etc.)
- Shape: Dimensions for arrays/lists (e.g.,
2 x 3 for numpy arrays)
- Value: Preview of the variable's content (truncated for long values)
Usage
Open the Variables Inspector
- Click the
$(symbol-variable) icon in the Activity Bar to open the "Python Variables" sidebar
Start a Python Debug Session
- Set breakpoints in your Python code
- Start debugging (F5)
View Variables
- When execution stops at a breakpoint, variables are automatically displayed
- Click the "Variables" button in the sidebar panel to manually refresh
- Execute commands in the Debug Console - variables update automatically
Requirements
- Visual Studio Code v1.106.1 or higher
- Python extension for VS Code (for debugging support)
- Active Python debug session
Extension Settings
This extension does not add any additional VS Code settings. It works out of the box once installed.
Known Issues
- Variables are only displayed when the debugger is paused (at breakpoints or after stepping)
- Very large data structures may have their values truncated in the preview
Release Notes
0.0.1
Initial release of Python Debug Variables extension:
- Variable inspector sidebar panel
- Automatic variable updates on breakpoint stops
- Automatic updates after Debug Console commands
- Filtered display of user-defined variables
- Support for shape/dimension information
Contributing
Found a bug or have a feature request? Please open an issue on our GitHub repository.
Enjoy debugging with better visibility! 🐍
| |