3

I am not able to highlight the matching variables in JSP and scriptlets. I have already tried
Window -> Preferences -> Java -> Editor -> Mark Occurrences
and
Preferences > General > Editors > Text Editors > Annotations.
These are not working.

Is there any way I can highlight the matching variables in JSP and scriplets?

I am using Eclipse Java EE IDE for Web Developers.
Version: Luna Release (4.4.0)

Thanks a lot in advance.

Thanks & Regards,
Archana

informatik01
  • 16,038
  • 10
  • 74
  • 104

1 Answers1

1

It appears that JSP files are opened in Eclipse using their own 'editor' distinct from the Java editor. Its settings are located under Window -> Preferences -> Web -> JSP Files -> Editor, but unfortunately it appears to lack the 'mark occurrences' feature found in the editors for Java and some other languages.

There's an answer to another question on here with information on how to implement 'mark occurrences' in an editor (pointing to Source viewers and annotations in the Eclipse developers guide), but I couldn't even find a bug in the Eclipse JSP 'product' requesting the feature. It's open-source, though, so of course anyone is welcome to contribute that functionality!


It doesn't accomplish quite the same thing (lacking the intelligence to restrict scope), but you can get a rough approximation of this functionality by selecting your variable/method/text and using the generic Source -> Occurrences in File feature.

David R. Hedges
  • 421
  • 5
  • 5