Skip to content

Show breakpoint widget on Alt+click in gutter#308687

Merged
roblourens merged 2 commits intomicrosoft:mainfrom
yogeshwaran-c:feat/alt-click-conditional-breakpoint
Apr 10, 2026
Merged

Show breakpoint widget on Alt+click in gutter#308687
roblourens merged 2 commits intomicrosoft:mainfrom
yogeshwaran-c:feat/alt-click-conditional-breakpoint

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

Summary

  • Adds Alt+click handling in the editor gutter to quickly add or edit conditional breakpoints
  • When Alt+clicking on a line without breakpoints, the breakpoint widget opens in conditional breakpoint mode
  • When Alt+clicking on a line with existing breakpoints, the breakpoint widget opens for editing the first breakpoint

This makes it easier to add conditional breakpoints without going through the context menu, consistent with how Shift+click toggles breakpoint enable/disable and middle-click opens the breakpoint widget.

Test plan

  • Alt+click on an empty gutter line: should open the breakpoint widget in conditional breakpoint mode
  • Alt+click on a gutter line with an existing breakpoint: should open the breakpoint widget to edit the breakpoint
  • Regular click on empty gutter line: should still add a breakpoint (no regression)
  • Shift+click on existing breakpoint: should still toggle enable/disable (no regression)
  • Middle-click behavior: should still work as before (no regression)

Fixes #203259

Add Alt+click handling in the editor gutter to quickly add or edit
conditional breakpoints. When Alt+clicking on a line without
breakpoints, the breakpoint widget opens in conditional breakpoint
mode. When Alt+clicking on a line with existing breakpoints, the
breakpoint widget opens for editing the first breakpoint.

Fixes microsoft#203259
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an Alt+click interaction in the editor glyph margin to open the breakpoint widget, improving the workflow for adding conditional breakpoints and editing existing breakpoints directly from the gutter.

Changes:

  • Handle Alt+click on an existing breakpoint to open the breakpoint widget for editing.
  • Handle Alt+click on an empty gutter line to open the breakpoint widget preselected to “Conditional Breakpoint”.
Show a summary per file
File Description
src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts Adds Alt+click mouse handling in the glyph margin to open the breakpoint widget in edit/conditional modes depending on whether breakpoints already exist on the line.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts:337

  • Because the altKey check comes before middleButton, Alt+middle-click on an empty gutter line will now open the conditional breakpoint widget instead of honoring the configured debug.gutterMiddleClickAction. To avoid regressing middle-click behavior, consider either (1) checking middleButton first, or (2) requiring e.event.leftButton for the Alt+click path.
					if (e.event.altKey) {
						// Alt+click on empty gutter opens the breakpoint widget for adding a conditional breakpoint
						this.showBreakpointWidget(lineNumber, undefined, BreakpointWidgetContext.CONDITION);
					} else if (e.event.middleButton) {
  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Copy link
Copy Markdown
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

Nice, thanks

@roblourens roblourens merged commit cf92c7d into microsoft:main Apr 10, 2026
43 of 45 checks passed
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 10, 2026
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.

Show breakpoint widget when alt+click in gutter

4 participants