Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>Breakpoint PythonNew to Visual Studio Code? Get it now.
Breakpoint Python

Breakpoint Python

Lesson Time AI

|
131 installs
| (0) | Free
Add and remove native python 'breakpoint()' in code by F9 in the editor.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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)

Context Menu

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

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Press F5 in VS Code to open a new Extension Development Host window
  4. 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
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft