Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Updating error markers after invoking validate
Updating error markers after invoking validate [message #1724320] Tue, 23 February 2016 02:31 Go to next message
Eclipse UserFriend
In my project, I'm invoking validation when certain conditions are met, which should flip an EObject from valid/invalid.

I see the validator get called, but the error markings in the Eclipse UI do not seem to stay reliably in sync.

If I'm working within one resource, everything updates perfectly, but if I'm making changes which affect an EObject in a separate resource, I see cases where:


  • an old error marker remains, despite invoking a new validation which generates no errors for the EObject
  • a new error marker is not created, despite invoking a new validation which generates errors for the EObject


I've tried invoking validation via both Diagnostician.validate and IResourceValidator.validate.

Closing and reopening the resource (file) causes the markers to update to the current state.

Is there any way to make an efficient update call for error markings in the eclipse UI to handle this?

Thanks!

EDIT for clarity:

The specific error markers I'm referring to are:

  • Red x icon on project, src folder, package and file in package explorer
  • Red x icon in left margin of editor window
  • Red x icon in bottom left of file editor tab
  • Red highlight under editor text
  • Error description in problems view

[Updated on: Wed, 24 February 2016 01:14] by Moderator

Re: Updating error markers after invoking validate [message #1724322 is a reply to message #1724320] Tue, 23 February 2016 02:38 Go to previous messageGo to next message
Eclipse UserFriend
hi i am not sure what you mean by "invoking Validation".
the xtextbuilder uses IMarkerUpdater/DefaultResourceUIValidatorExtension for that job
Re: Updating error markers after invoking validate [message #1724324 is a reply to message #1724322] Tue, 23 February 2016 02:56 Go to previous messageGo to next message
Eclipse UserFriend
I mean that I am "manually" calling validate instead of waiting for it to be run by XText.

Thanks for the pointer. I'll look into that!
Re: Updating error markers after invoking validate [message #1724457 is a reply to message #1724324] Tue, 23 February 2016 23:58 Go to previous messageGo to next message
Eclipse UserFriend
p.s. for the open editor MarkerIssueProcessor is used as well (if this is the problem you describe in the other topic - you are a bit vague about the error elements you are talking about

(see ValidateActionHandler / ValidatingEditorCallback
Re: Updating error markers after invoking validate [message #1724468 is a reply to message #1724457] Wed, 24 February 2016 01:11 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the pointer, I'll have a look.

How exactly are you defining "the open editor". Can there be only one open editor?

Specifically, the problem I'm having is with updating the error UI markers for editor tabs which are not currently active.

If I close the tab and reopen it, the UI seems to refresh and everything is fixed.

I updated the list of error markers in the other post, and will include it here as well.

I started that other post because I thought I might just be going about this the entirely wrong way, and it seemed worth a separate thread, dedicated to the idea of triggering validation of a resource which isn't the active editor. If you have any thoughts on that general topic, it would be greatly appreciated!
Re: Updating error markers after invoking validate [message #1724472 is a reply to message #1724468] Wed, 24 February 2016 02:11 Go to previous messageGo to next message
Eclipse UserFriend
i have no idea on that. but with my pointers you should be ablte to debug xtends behaviour.

btw are you sure xtend updates its markers and not only the jdt markers that are copied to xtend in DerivedResourceMarkerCopier
Re: Updating error markers after invoking validate [message #1724948 is a reply to message #1724472] Sat, 27 February 2016 12:18 Go to previous message
Eclipse UserFriend
I'm adding an update here in case anyone comes across this thread.

It turned out that the best solution to my problem was to not manually invoke validation myself.

Instead, thanks to a helpful pointer, I'm just helping Xtext to discover and process all affected resources during a single validation pass.

See this other thread for more info.
Previous Topic:Using xtend in RCP
Next Topic:Triggering "re-validation" of non-dirty resource
Goto Forum:
  


Current Time: Sun Jul 27 11:57:27 EDT 2025

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

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

Back to the top