Skip to content

DAP: a stop at a breakpoint that the debug adapter moved is not reported as a breakpoint stop when the adapter sends no hitBreakpointIds #1999

Closed

Description

@muescha

Problem

Debug adapters often move a breakpoint to the nearest line with code, for example from a blank line or a comment. When the adapter then stops there and its stopped event has no hitBreakpointIds, LSP4IJ doesn't find the IntelliJ breakpoint and reports the stop as a plain position (positionReached), not as a breakpoint stop (breakpointReached).

debugpy does both. Claude Code reproduced it at the protocol level with the debugpy bundled in IntelliJ IDEA 2026.3:

def run():
    total = 0
                        # line 3: blank
    # comment           # line 4
    for i in range(3):

setBreakpoints for lines 3 and 4 is answered with [{"verified": true, "id": 0, "line": 2}, {"verified": true, "id": 1, "line": 2}]. The stopped event has reason: "breakpoint", no hitBreakpointIds, and the top frame is on line 2.

What the user sees

The program stops at the right place, and the breakpoint is shown as verified. But since IntelliJ doesn't learn which breakpoint stopped it:

  • "Breakpoint hit" message, "Stack trace" and "Evaluate and log" of a suspending breakpoint are not shown.
  • "Remove once hit" doesn't remove the breakpoint, and breakpoints that wait for this one ("Disable until hitting the following breakpoint") stay disabled.
  • A breakpoint with "Suspend" off and no log message (for example only "Stack trace") is sent without logMessage, so the adapter stops, and the IDE suspends although "Suspend" is off.

Cause

On main, the results of setBreakpoints are mapped by position, and a stop with hitBreakpointIds is mapped by id. Without ids, getStopBreakpoint falls back to findBreakpoint(topFrame), which compares the frame's line with the line of the IntelliJ breakpoint (line 475), not with the line the adapter moved it to. So no breakpoint is found, and positionReached is called.

This is not new in 0.30.0, so it's not a blocker for the release.

Fix

A PR is in progress: remember on each IntelliJ breakpoint the line that the adapter answered in setBreakpoints, and let the stop lookup without hitBreakpointIds also match that line. A breakpoint that was not moved wins over a moved one on the same line.

An earlier version of this fix was checked in IntelliJ IDEA 2026.3 EAP with the debugpy bundled with the IDE, with a DAP breakpoint on the blank line 3 and "Breakpoint hit" turned on:

The breakpoint on line 3 is verified, although debugpy moved it to line 2:

Breakpoint on line 3 shown as verified

The session stops on line 2:

Debug session stopped on line 2 of moved.py

The console shows "Breakpoint reached: moved.py:3". IntelliJ prints this only when the stop is reported with breakpointReached for that breakpoint. On main this line is missing, since the stop is reported with positionReached:

Console with "Breakpoint reached: moved.py:3"

Activity

  1. added a commit that references this issue on Nov 21, 2026
    a6ed160
  2. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions