Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Updating error markers after invoking validate
Updating error markers after invoking validate [message #1724320] Tue, 23 February 2016 07:31 Go to next message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 124
Registered: October 2015
Senior Member
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 06:14]

Report message to a moderator

Re: Updating error markers after invoking validate [message #1724322 is a reply to message #1724320] Tue, 23 February 2016 07:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
hi i am not sure what you mean by "invoking Validation".
the xtextbuilder uses IMarkerUpdater/DefaultResourceUIValidatorExtension for that job


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Updating error markers after invoking validate [message #1724324 is a reply to message #1724322] Tue, 23 February 2016 07:56 Go to previous messageGo to next message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 124
Registered: October 2015
Senior Member
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] Wed, 24 February 2016 04:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
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


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Updating error markers after invoking validate [message #1724468 is a reply to message #1724457] Wed, 24 February 2016 06:11 Go to previous messageGo to next message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 124
Registered: October 2015
Senior Member
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 07:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
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


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Updating error markers after invoking validate [message #1724948 is a reply to message #1724472] Sat, 27 February 2016 17:18 Go to previous message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 124
Registered: October 2015
Senior Member
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: Tue Sep 27 01:54:16 GMT 2022

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

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

Back to the top