| Summary: | Highlight all references to variable in current editor | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Kurt Kellner <kkellner> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | akiezun, vinay.soni |
| Version: | 2.0 | ||
| Target Milestone: | 2.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Kurt Kellner
By the way, I do know about the "Open Declaration" popup menu option that takes you to the delclaration of a variable (or class if cursor is over a class name). This feature request is just expanding this to highlight (e.g., yellow background) uses of the selected variable within the current scope. We can find this exact references using the AST API, but this will have to wait until after 2.0 I'm sorry to hear this will not make it into v2.0 of eclipse, but I understand the need to cutoff new features. Since there will be more time to develop this feature in a future version of Eclipse, I'll add a few additional requirements to the enhancement. Highlight variable usage in current scope: 1. Colorize read access and write access differently. Example, read access with a yellow background and black letters, write access with yellow background and red letters. 2. Option to auto-highlight the variable references when the cursor sits on a variable for n milliseconds. looks like we are thinking along the same lines with regard to "semantic syntax coloring". one last addition - if you would like to see this features sooner do not hesitate to contribute them. Reopening for 2.1 consideration *** Bug 7212 has been marked as a duplicate of this bug. *** Beautiful. I ony hope colors will be customizable. I can't say anything more. Vinay I have some analysis that might help here:
The following was mentioned earlier:
>2. Option to auto-highlight the variable references when the cursor sits on a
>variable for n milliseconds.
Let us say that I am on a variable "salary" and after 5 seconds all occurances
in scope are auto-highlighted. Based on this auto-highlighting I decide to
change some code and move a few lines up or down. Now 5 seconds are again
elapsed in thinking while I am on another variable "age" . If the original
highlight of "salary" is automatically undone in favour of the auto-
highlighting "age", it would be counter productive as I still have interest in
highlighted occurances of "Salary" and not "age".
Therefore this "n milliseconds" concept may not be very useful.
Instead a user should be explicitly able to express interest in a variable
reference. If a user goes on "salary" and either through mouse or hot-keys
instructs the UI Component to highlight occurances, the highlight should stick,
until escape (or something else) is pressed to indicate a lack of interest. As
a result the highlight is preserved as long as the user analysing the code has
use for the highlight (and the UI Component does not attempt to be more
intelligent than the user in making this determination).
This is more User friendly IMO.
This is probably easier to implement (IMHO).
Another aspect is when occurances span more than one page. If the occurances on
next or previous pages are marked in a gutter (on the side ) as hyperlinks (
like the compilation errors are done today ) using a different color than red,
it would look good.
Hope this helps.
Thanks,
Vinay
*** Bug 21359 has been marked as a duplicate of this bug. *** Releated to #13783. I was looking at this and would like to add a clearification:
>As a result the highlight is preserved as long as the user analysing the code
>has use for the highlight
1. Highlight should preserved as long as user desires.
2. To end the highlight explicit mechanism should be used (like esc)
3. During the highlight user should be able to edit other code without
effecting the highlight.
Is this currently planned for 2.1? It would be one of the most significant improvements IMHO (as far as developer friendliness is concerned) if it made 2.1 I am interested in knowing about this as well - if possible? Thanks and Regards, Vinay Version 3.0 of IntelliJ just arrived. I did a feature by feature comparison of the two IDEs. IntelliJ is really more smart than Eclipse as far as core coding is concerned. While there are a lot of smarts that IntelliJ has that Eclipse does not have, without this one Eclipse is actually starting to look backwards in comparison. I have in the past requested many features and those have been added and make Eclipse look great when compared to IntelliJ. Please listen to this request guys. This will make Eclipse compete with other upcoming IDEs. Is available in 2.1 (Find Occurrences in File). |