Search code examples
eclipseeclipse-plugineclipse-rcpxtext

Advanced text highlight settings for eclipse-plugin


Is it possible to change default settings for the background color of highlighted expressions in the code editor?

When I place the cursor on a method, other places the method exists are grey backgrounded. The same background color appears by placing the cursor on a class. How can I change the background color of highlighted methods to red and the background color of highlighted classes to green?


Solution

  • What you are looking for is "Mark Occurrences". In Xtext these are computed by instances of IOccurrenceComputer. The default implementation is DefaultOccurrenceComputer. If you replace this instance with your own implementation (inside your module class using Guice) you can return your own Annotation's. You can then provide your own extensions to the annotations extension point from eclipse with colors of your choice.