Skip to content

Show exit-only method breakpoint annotation at the closing brace - #1061

Open
SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:exit
Open

SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:exit

Conversation

@SougandhS

Copy link
Copy Markdown
Member

Toggling a method exit breakpoint on the closing brace created the breakpoint, but its annotation stayed on the method declaration line. Place the marker on the closing brace for exit-only breakpoints, and on the method line when entry is also enabled. Toggling on the closing brace of an existing method breakpoint now switches its exit mode instead of deleting it & Toggling on the method line of an existing method exit breakpoint now switches its entry + exit mode instead of deleting it

Screen.Recording.2026-11-14.at.9.55.47.AM.mov

Author checklist

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

Annotation relocation skips attached JAR source and can fail for renamed or deleted methods, while breakpoint mode switching and marker tracking lack automated regression coverage.

3 open issues
What changed in this PR

Updates Java method breakpoint annotations to appear at the closing brace for exit-only breakpoints and at the method declaration when entry is enabled.

Changes:

  • Centralizes marker relocation and applies it when entry/exit settings change.
  • Changes editor toggling to switch existing breakpoint modes in the specified cases instead of deleting the breakpoint.
  • Tracks the exit-only marker’s line after document edits.
File Description
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​BreakpointUtils.java Adds shared method breakpoint marker relocation.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​breakpoints/​MethodBreakpointEditor.java Relocates the marker when breakpoint properties are saved.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​BreakpointMarkerUpdater.java Tracks closing-brace marker lines after edits.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​actions/​ToggleBreakpointAdapter.java Switches existing breakpoint modes and positions new exit-only markers.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​actions/​ExitToggleAction.java Refreshes marker placement after toggling exit mode.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​actions/​EntryToggleAction.java Refreshes marker placement after toggling entry mode.

Review effort: Balanced

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

Active issues leave exit-only breakpoints misplaced in source-attached class files, retain markers for deleted methods, and make new tests vulnerable to toggle-job timing races.

3 open issues
3 resolved since last review

Review effort: Balanced

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 marker checks can delete valid exit breakpoints on save when markers remain declaration-anchored or tracked positions expand after edits before the closing brace, requiring anchoring fixes and regression coverage.

2 open issues
3 resolved since last review

Review effort: Balanced

Toggling a method exit breakpoint on the closing brace created the
breakpoint, but its annotation stayed on the method declaration line.
Place the marker on the closing brace for exit-only breakpoints, and on
the method line when entry is also enabled. Toggling on the closing
brace of an existing method breakpoint now switches its exit mode
instead of deleting it.
@SougandhS
SougandhS marked this pull request as ready for review November 14, 2026 05:31
@SougandhS SougandhS added the enhancement New feature or request label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants