5

I am working on an eclipse plugin that implements a new editor. I would like to implement "Mark Occurences" wherein when the cursor is on one variable, all its occurances in the open editor are highlighted. Is there a way to implement this? Thanks!

robinst
  • 30,027
  • 10
  • 102
  • 108
Smitha
  • 51
  • 2

3 Answers3

3

You need to implement your own Annotations and display them using your SourceViewer.

Maybe start reading about this here: http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/editors_annotations.htm

Arne Deutsch
  • 14,629
  • 5
  • 53
  • 72
0

I know it's been long but if you still want answers, you can refer this.

AndyFaizan
  • 1,833
  • 21
  • 30
0

I don't know if this is what wou want to implement, but there is already an Eclipse plugin that highlights all occurrences for a given text (not only at editor view but in the currently focused view (search results, console, Navigator, outline, etc.), and does incremental text search too. That includes, but is not limited to, variables.

I'm talking about Eclipse Glance.

robinst
  • 30,027
  • 10
  • 102
  • 108
Francisco Alvarado
  • 2,815
  • 2
  • 26
  • 51