Overview Version History Q & A Rating & Review
Breakpoint Python VS Code Extension
This extension allows you to quickly add, remove, and toggle breakpoint()
statements in your code with simple commands, keyboard shortcuts, and visual indicators.
Features
Add breakpoint()
: Insert a breakpoint()
statement above your cursor position with proper indentation
Remove breakpoint()
: Remove breakpoint()
statements from the current line or adjacent lines
Toggle breakpoint()
: Smart toggle that adds breakpoints when none exist, or removes them when they do (Python files only)
Visual indicators: Shows gutter icons next to lines containing breakpoint()
statements in Python files
Multi-selection support: Works with multiple cursors and selections
Smart indentation: Automatically maintains proper code indentation
Usage
Command Palette
Open the Command Palette (Ctrl+Shift+P
or Cmd+Shift+P
on Mac) and type:
"Breakpoint Python: Add Breakpoint()" - Insert a breakpoint()
at the cursor
"Breakpoint Python: Remove Breakpoint()" - Remove breakpoint()
from the current/adjacent lines
"Breakpoint Python: Toggle Python Breakpoint" - Toggle breakpoints (Python files only)
Keyboard Shortcuts
F9 - Toggle breakpoint (Python files only)
Ctrl+Shift+B - Add breakpoint (any file)
Ctrl+Shift+Alt+B - Remove breakpoint (any file)
Right-click in the editor to access:
Add Breakpoint()
Remove Breakpoint()
Toggle Python Breakpoint (Python files only)
Visual Indicators
In Python files, you'll see gutter icons next to lines that contain breakpoint()
statements.
Note: This extension does not support gutter clicking. Use keyboard shortcuts or commands instead.
How It Works
Add Breakpoint
Inserts breakpoint()
on a new line above your cursor position
Maintains proper indentation based on the current line
Won't add duplicates if a breakpoint already exists on the same line
Remove Breakpoint
Removes breakpoint()
statements from the current line
Also checks adjacent lines (above and below) for breakpoints to remove
Handles multiple selections efficiently
Toggle Breakpoint (Python only)
If no breakpoint exists near the cursor, adds one
If a breakpoint exists on the current line or adjacent lines, removes it
Works with multiple selections to toggle breakpoints on multiple lines at once
Language Support
Add/Remove commands: Work in any file type
Toggle command: Restricted to Python files (.py
)
Visual indicators: Only shown in Python files
Development
Clone this repository
Run npm install
to install dependencies
Press F5
in VS Code to open a new Extension Development Host window
Use the commands as described above
Testing
Run the test suite with:
npm test
Packaging
To package the extension for distribution:
npm install -g vsce
vsce package
Notes
The extension intelligently handles indentation to match your code style
Multiple cursor/selection support allows bulk operations
The toggle functionality is optimized for Python development workflows
Visual gutter indicators help you quickly identify where breakpoints are placed