Repository navigation
debug: send the mode of exception breakpoints to the debug adapter - #341972
Connor Peet (connor4312) merged 7 commits into
Conversation
… adapter The UI lets users pick a mode for an exception breakpoint, but sendExceptionBreakpoints only sent the condition in the filter options, so the mode never reached the adapter. Send it as well.
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
🟡 Changes recommended
The new test omits required constructor properties and triggers an unhandled initialization error.
2 open findings
What changed in this PR
Addresses #272410 by forwarding selected exception breakpoint modes to debug adapters.
Changes:
- Includes configured modes alongside conditions in exception filter options.
- Adds regression coverage for plain, conditional, mode-only, and combined breakpoints.
| File | Description |
|---|---|
| src/vs/workbench/contrib/debug/test/browser/debugSession.test.ts | Adds exception breakpoint serialization coverage. |
| src/vs/workbench/contrib/debug/browser/debugSession.ts | Sends exception breakpoint modes to adapters. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| session.initializeForTest(raw); | ||
| const initialized = Event.toPromise(raw.onDidInitialize); | ||
| adapter.sendEventBody('capabilities', { capabilities: { supportsExceptionFilterOptions: true } }); | ||
| adapter.sendEventBody('initialized', {}); | ||
| await initialized; |
|
|
||
| test('sends the condition and mode of exception breakpoints', async () => { | ||
| const { session, exceptionFilterOptions } = await createSession(); | ||
| const options = { label: 'Label', supportsCondition: true, enabled: true }; |
|
Thanks for the review, both points were valid and are fixed in the latest commit: the raw session is now initialized before the session attaches its listeners (so the session's own initialization, which needs more services than the test session has, no longer runs), and the |
Initialize the raw session before the session attaches its listeners and provide all required ExceptionBreakpoint options.

Fixes #272410
Problem
The Breakpoints view lets users choose a mode for an exception breakpoint ("Edit Mode..."), and the mode is stored on the breakpoint. But
DebugSession.sendExceptionBreakpointsonly put theconditioninto theExceptionFilterOptions, so themodewas never sent to the debug adapter and had no effect.Fix
Add
mode(when set) to theExceptionFilterOptionssent insetExceptionBreakpoints, next tocondition.ExceptionFilterOptions.modeis part of the DAP spec and the UI already re-sends the exception breakpoints after a mode change. Requests for breakpoints without a condition or mode are unchanged.Tests
Added a test to
debugSession.test.tsthat checks the filter options sent for breakpoints with no options, a condition, a mode, and both. It fails onmain(the mode is missing) and passes with this change; the wholedebugSession.test.tssuite passes (run in a browser).