Bug 237917 - Scope outline annotations
Summary: Scope outline annotations
Status: RESOLVED DUPLICATE of bug 69455
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 07:59 EDT by Per Lauge Holst CLA
Modified: 2008-07-03 06:57 EDT (History)
2 users (show)

See Also:


Attachments
Example of scope annotations/styles in java comments (1.84 KB, text/plain)
2008-07-02 06:44 EDT, Per Lauge Holst CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Per Lauge Holst CLA 2008-06-20 07:59:21 EDT
To help understand legacy code I feel it would be beneficial to know where you are in a method in an object - much like the breadcrumb tells where your method is with regards to package and project.

An especially nice feature would be to identify Java synchronized blocks, but also   - for any multi page, multi nested scopes - to actually be able to quickly understand the context you're in. Thus this is not a Java only feature.

Whether this be done like the breadcrumb, an annotation, different background color, tooltip hover, or any combination thereof. I think it would help understand bad code and help with the mental refactoring plans.

This would probably tie in with scope folding.

Best regards,
Per Holst
Comment 1 Eric Moffatt CLA 2008-06-20 15:16:38 EDT
Passing to JDT for initial comments...
Comment 2 Dani Megert CLA 2008-06-21 03:49:05 EDT
This is a pretty generic request. Can give several more examples? Regarding synchronized blocks: there's already an enhancement request to highlight those (search JDT Text to find it).
Comment 3 Martin Aeschlimann CLA 2008-06-27 05:20:27 EDT
We need more info here. Can you give a code example or screenshot that illustrates the problem and/or solution?
Comment 4 Per Lauge Holst CLA 2008-06-30 02:41:18 EDT
Sure, I'll get on it - I'm currently traveling, but I'll see if I can't get to create at least a sketch.
Comment 5 Per Lauge Holst CLA 2008-07-02 06:44:36 EDT
Created attachment 106294 [details]
Example of scope annotations/styles in java comments

Bracket positions on new lines - they're supposed to indicate where I believe the scope changes should take place. There's probably a problem with empty (no label) scopes.
scopes has been put into 3 types: synchronized, loop (for, while), and branch (if, else, switch, case) - while and switch has been left out.
Labels are meant as a mouse hover on scope label - possibly aggregated.
Style is meant as an indication of code layout (colors, font, etc.)  - CSS influenced.
Comment 6 Dani Megert CLA 2008-07-02 06:58:32 EDT
I guess it goes into same direction as bug 69455.
Comment 7 Dani Megert CLA 2008-07-02 07:08:39 EDT
>I guess it goes into same direction as bug 69455.
Or do you suggest to introduce new tags/comments to mark the scopes?
Comment 8 Per Lauge Holst CLA 2008-07-03 06:57:04 EDT
You're quite right - it goes in the same direction as 69455. My suggestion simply added mouse over tool tip on the scope.

I didn't suggest special comment tags to allow programmers to introduce their own scope definitions, but that may be a better way than information overload on deeply nested scopes.


*** This bug has been marked as a duplicate of bug 69455 ***