| Summary: | [navigation] Ctrl+click on continue must jump to the label | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Deepak Azad <deepakazad> | ||||
| Component: | Text | Assignee: | Raksha Vasisht <raksha.vasisht> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P2 | CC: | daniel_megert, markus.kell.r | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 M7 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
> - Ctrl+click 'continue' at 1 => it jumps to label 'bbb'
> Expected: Jump to the for statement labelled 'bbb'. This would be similar to
> how Ctrl+click on 'break' works.
Yes, but it would not match the Mark Occurrences target. That one also marks the label, and I actually like that behavior (since it really continues at the label, and if you have complicated code with many labels, the label is more interesting than the 'for').
Selecting 'for' is just a fallback if the ContinueStatement misses a label.
For ultimate consistency, I would rather change //2 to highlight and jump to the label as well.
> For ultimate consistency, I would rather change //2 to highlight and jump to
> the label as well.
+1. Raksha, please fix Ctrl+click and the semantic highlighting.
(In reply to comment #2) > > For ultimate consistency, I would rather change //2 to highlight and jump to > > the label as well. > +1. Raksha, please fix Ctrl+click and the semantic highlighting. Fixed in org.eclipse.jdt.internal.ui.search.BreakContinueTargetFinder.java The fix is good but it missed to update the highlighting/finding in case of 'break': it should also highlight the label and not the statement - like in the (fixed) 'continue' case. Also, no tests were added. I've fixed both issues in HEAD. Available in builds >= I20110421-1300. Created attachment 193809 [details]
Part 2 of fix
Verified in I20110425-1800. |
---------------------------------------------------------------------- package snippet; public class Snippet { public static void main(String[] args) { aaa: for (int i= 0; i < args.length; i++) { String string= args[i]; bbb: for (int j= 0; j < string.length(); j++) { char ch= string.charAt(j); switch (ch) { case 'a': continue bbb; //1 case 'b': break bbb; case 'c': continue; //2 case 'd': break; } if (ch == 0) { System.out.println(ch); break; } } } } } --------------------------------------------------------------------- - Ctrl+click 'continue' at 2 => it jumps to 'for' labelled 'bbb' - Ctrl+click 'continue' at 1 => it jumps to label 'bbb' Expected: Jump to the for statement labelled 'bbb'. This would be similar to how Ctrl+click on 'break' works.