PyDebugVisualizer
Visualize Python data structures during debugging in VS Code.
Features
- Interactive Graph Visualization: View your Python objects, lists, dictionaries, and their relationships as interactive graphs
- Memory State Tracking: See how your data structures evolve during debugging
- Diff Visualization: Highlight changes between debug steps (additions in green, deletions in red, modifications in orange)
- Seamless Integration: Works with VS Code's built-in Python debugger
Requirements
- Visual Studio Code 1.106.0 or higher
- Python extension for VS Code
- A Python project with debugging configured
Installation
- Install the extension from the VS Code Marketplace
- Open a Python project in VS Code
- Start debugging your Python code
Usage
Starting a Debug Session
- Open a Python file in VS Code
- Set breakpoints by clicking in the gutter (left of line numbers)
- Press
F5 or click the Run and Debug button in the sidebar
- Select Python File or your configured debug configuration
Viewing Memory Visualization
Once your debugger hits a breakpoint, you have three ways to open the visualization:
Method 1: Keyboard Shortcut (Fastest)
- Press
Ctrl+Shift+M (Windows/Linux) or Cmd+Shift+M (Mac)
Method 2: Activity Bar Icon
- Look for the PyDebug Visualizer icon in the Activity Bar (left sidebar)
- Click on it to open the side panel
- Click "Show Visualization" button
Method 3: Command Palette
- Press
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Type "PyDebugVisualizer: Show Visualization"
- Press Enter
Understanding the Visualization
The visualization displays your Python objects as a graph:
- Nodes: Represent variables and objects in memory
- Edges: Show references between objects
- Colors:
- 🟢 Green: New objects or variables added since the last step
- 🔴 Red: Objects or variables removed since the last step
- 🟠 Orange: References that have been modified
- ⚪ White/Default: Unchanged objects
Interactive Controls
The visualization panel includes several controls:
- 🔄 Refresh: Update the visualization with the current debug state
- [ ] Center: Center and fit the graph to the viewport
- ➕ Zoom In: Zoom in on the graph
- ➖ Zoom Out: Zoom out from the graph
Tips
- Use step over (
F10) or step into (F11) to see how your data evolves
- The visualization automatically updates when you step through code
- Complex structures with many objects may take a moment to render
- Click the refresh button if the visualization doesn't update automatically
Feedback & Issues
Found a bug or have a suggestion? Please report it on our GitHub repository.
License
MIT License - see LICENSE file for details
| |