The purpose of the IPresentationDamager
is to take a document change done by the user and calculate the affected area of the document that needs to be redrawn as a result. I suspect it's typical use is to expand the damage area to include at least whole tokens so that the "repairer" can correctly scan that region to give correct syntax highlighting.
The IPresentationRepairer
does actual syntax highlighting, by scanning the text of the region marked as damaged and figuring out the right colors.
Semantic highlighting is generally done in another thread so that it can benefit from the parsing/compilation work being done without blocking the user's next key presses while it does all that.
When it is done, it has to trigger a redraw of the document regions that were affected.
The java editor works very hard to maintain the presence of existing semantic highlights in the presence of edits, shifting them around as you edit rather than recalculating them from the AST.
The Eclipse Java semantic highlighting stuff is in and around the class org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingPresenter
Many plugins don't check for errors until you save, but the Java plugin checks as you type. It schedules the build as a background job. It is quite advanced.