Implement "Mark Occurrences" in new Eclipse editor [closed]
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
开发者_JAVA百科 Improve this questionI 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!
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
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.
I know it's been long but if you still want answers, you can refer this.
精彩评论