I have my own Eclipse editor, and I implemented "input report errors", but from time to time my squigglies errors (using JFace annotations) do not appear or do not delay after they are deleted.
I am using MonoReconciler with my implementation of IReconcilingStrategy . During the reconcile step, I call annotationModel.replaceAnnotations to remove old errors and add new ones. In most cases, this works great. Updates are lost from time to time, and I notice the following:
- the red mark on the left ruler disappears, but the red underscores remain
- on the next character I type, the underline disappears
I checked in the debugger the correct annotation calculations. The underscore disappears immediately after entering a character, and not after a 500 ms mediator delay. It looks like a lost UI update / redraw.
Somewhere there must be a race condition (the mediator is working in its own thread). What am I doing wrong? I could not find the documentation for this case.
Edit: To reproduce, browse the scala-worksheet and create a new one. A type
object Test { val m = Map( 't' -> 1 ) }
Now edit the arrow: delete > . The disadvantage is emphasized. Enter a space, it returns. Add it back, the underline still exists until you type another space.
I fixed it by calling invalidateTextPresentation on the SourceViewer substring, but it seems to me that this is not necessary. I would like to understand how to use editor annotations correctly.
PS. Lost updates can also be seen in this screencast .
source share