Community
Participate
Working Groups
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
Passing to JDT for initial comments...
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).
We need more info here. Can you give a code example or screenshot that illustrates the problem and/or solution?
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.
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.
I guess it goes into same direction as bug 69455.
>I guess it goes into same direction as bug 69455. Or do you suggest to introduce new tags/comments to mark the scopes?
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 ***