Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Race conditions in AnnotationModel? Error annotations lost in Reconciler
Race conditions in AnnotationModel? Error annotations lost in Reconciler [message #922964] Tue, 25 September 2012 13:45
Iulian Dragos is currently offline Iulian DragosFriend
Messages: 23
Registered: July 2009
Junior Member
I have an Eclipse custom editor and I implemented 'report errors as you type', but every now and then my error squigglies (using JFace annotations) are not shown or linger after they should be removed.

I am using MonoReconciler with my implementation of IReconcilingStrategy. During the reconcile step I call annotationModel.replaceAnnotations to remove the old errors and add the new ones. Most of the times this works fine. Every now and then the updates are lost, and I notice the following:

- the red stamp on the left ruler disappears, but the red underlines stay
- on the next character I type, the underline disappears

I verified in the debugger that the annotations are correctly calculated. The underline disappears immediately after typing a character, and not after the 500ms delay of the reconciler. It looks like a lost UI update/redraw.

There must be a race condition somewhere (the reconciler runs in its own thread). What am I doing wrong? I couldn't find any documentation about this use-case.

Edit: To reproduce, checkout (sorry, can't post a link outside yet) and create a new one. Type

object Test {
   val m = Map( 't' -> 1 )

Now edit the arrow: remove the >. The underline is missing. Type a space, it comes back. Add it back, the underline is still there until you type another space.

I fixed it by calling invalidateTextPresentation on the underling SourceViewer, but it seems to me that shouldn't be necessary. I'd like to understand what is the correct way to use editor annotations.
Previous Topic:Shutdown process and builder with UI-Dependencies
Next Topic:How does one automatically configure the Network Connection Preference
Goto Forum:

Current Time: Fri May 25 07:25:30 GMT 2018

Powered by FUDForum. Page generated in 0.01852 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top