Bug 373201 - [painting] Removing a breakpoint does not remove the squiggly line from the Java editor
Summary: [painting] Removing a breakpoint does not remove the squiggly line from the J...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M7   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 403401 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-04 11:23 EST by Deepak Azad CLA
Modified: 2013-04-30 11:14 EDT (History)
3 users (show)

See Also:
daniel_megert: review-


Attachments
Patch (8.85 KB, patch)
2013-04-08 08:34 EDT, Noopur Gupta CLA
daniel_megert: review-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2012-03-04 11:23:51 EST
3.8 master
- Enable Breakpoint annotation to be shown in Text as a squiggly line

- Add a breakpoint via double clicking in the vertical ruler
=> A blue circle appears in the vertical ruler and a squiggly blue line appears in the editor. GOOD.

- Remove the breakpoint via double clicking in the vertical ruler
=> The blue circle disappears from the vertical ruler. GOOD
However, the blue squiggly line remains in the editor. BAD

Things work fine for other annotations e.g. Bookmark
Comment 1 Dani Megert CLA 2012-03-12 07:42:13 EDT
Works in 3.6.2 but no longer since 3.7. It also works for bookmarks. Might be some strange data in the breakpoint marker that surfaces this bug.
Comment 2 Noopur Gupta CLA 2013-04-05 06:38:18 EDT
Observation: It works from next time if the breakpoint is added/removed via Undo/Redo. 

Steps:
1. Enable Breakpoint annotation to be shown in Text as a squiggly line
2. Add a breakpoint via double clicking in the vertical ruler. Blue circle and squiggly blue line appears.
3. Remove the breakpoint via double clicking in the vertical ruler. Blue circle disappears but squiggly line remains. => Bug.

4. Focus out from the editor and bring the focus to Breakpoints view. 
5. Press Ctrl+Z, blue circle appears back.
6. Press Ctrl+Y, blue circle is gone along with the squiggly line.
Comment 3 Noopur Gupta CLA 2013-04-08 08:34:05 EDT
Created attachment 229439 [details]
Patch

The issue is in the way ToggleBreakpointAction calls DebugUITools.deleteBreakpoints(..), while removing the breakpoint on double-clicking the breakpoint circle at the vertical ruler. 

(RemoveBreakpointAction also removes a breakpoint by calling DebugUITools.deleteBreakpoints(..), when user selects the breakpoint in the Breakpoints view and clicks on "Remove Selected Breakpoints" from the view's toolbar. In this case the bug does not exist as it is run as a worksapce runnable.)

The patch has moved the call to DebugUITools.deleteBreakpoints(..) in ToggleBreakpointAction into a workspace runnable.

Dani, please check.
Comment 4 Dani Megert CLA 2013-04-11 09:57:33 EDT
Comment on attachment 229439 [details]
Patch

The patch makes the bug go away, but it is not fixing the broken code.

The fact that the breakpoint goes away in the ruler indicates that the editor got correctly notified about the removal. Also, when typing something on the line with the blue underline, it disappears. This indicates that the bug is in the text editor infrastructure. Probably in the AnnotationPainter.
Comment 5 Dani Megert CLA 2013-04-11 10:10:20 EDT
The problem was that we forgot to update 'highlightAnnotationRangeStart' and 'highlightAnnotationRangeEnd' at all places.

Fixed with http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=0ccdaa6315d0fbc1c1697d08118cc38aca949f64
Comment 6 Dani Megert CLA 2013-04-30 11:14:43 EDT
*** Bug 403401 has been marked as a duplicate of this bug. ***