Skip to content

debug: send the mode of exception breakpoints to the debug adapter - #341972

Merged
Connor Peet (connor4312) merged 7 commits into
microsoft:mainfrom
alok-108:fix/272410-exception-breakpoint-mode
Nov 2, 2026
Merged

Connor Peet (connor4312) merged 7 commits into
microsoft:mainfrom
alok-108:fix/272410-exception-breakpoint-mode

Conversation

@alok-108

Copy link
Copy Markdown
Contributor

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.sendExceptionBreakpoints only put the condition into the ExceptionFilterOptions, so the mode was never sent to the debug adapter and had no effect.

Fix

Add mode (when set) to the ExceptionFilterOptions sent in setExceptionBreakpoints, next to condition. ExceptionFilterOptions.mode is 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.ts that checks the filter options sent for breakpoints with no options, a condition, a mode, and both. It fails on main (the mode is missing) and passes with this change; the whole debugSession.test.ts suite passes (run in a browser).

… 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.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 08:18
@alok-108

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment on lines +240 to +244
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 };
@alok-108

Copy link
Copy Markdown
Contributor Author

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 ExceptionBreakpoint fixtures now include description and conditionDescription. The test file typechecks and the debugSession.test.ts suite passes.

Initialize the raw session before the session attaches its listeners and
provide all required ExceptionBreakpoint options.

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) November 2, 2026 16:44
@connor4312
Connor Peet (connor4312) merged commit c55a183 into microsoft:main Nov 2, 2026
51 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 2, 2026
@alok-108
Alok Pandey (alok-108) deleted the fix/272410-exception-breakpoint-mode branch November 3, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception Breakpoints don't honor BreakpointMode

5 participants