Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Detecting the end of validation?
Detecting the end of validation? [message #1735062] Wed, 15 June 2016 07:20 Go to next message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 124
Registered: October 2015
Senior Member
In my xbase project, I'm doing some custom tracking of resources which have been "affected" between build cycles.

I then query this tracking in a custom extension of DerivedStateAwareResourceDescriptionManager.isAffected() which is called repeatedly during the validation cycle.

My question is, how can I detect that such a cycle is complete so that I can clear my tracking? I've tried tracing the calls to the method, but I haven't been able to find a clear hook to trace when validation or build is complete.

For example, when I edit a file in my project and then save, I see a full validation run, along with a number of calls to isAffected() for the given deltas. How can I detect when this series of calls is complete?

Thanks!

[Updated on: Wed, 15 June 2016 07:20]

Report message to a moderator

Re: Detecting the end of validation? [message #1736615 is a reply to message #1735062] Thu, 30 June 2016 15:03 Go to previous messageGo to next message
Akos Kitta is currently offline Akos KittaFriend
Messages: 25
Registered: November 2015
Junior Member
Cannot you just check whether the build job is finished or not? As far as I know validation is run as part of the build, more precisely when building the new state of the Xtext index during the build.

org.eclipse.xtext.builder.builderState.AbstractBuilderState.updateMarkers(Delta, ResourceSet, IProgressMonitor)


So I would wait for the build job. You can find some examples here:

org.eclipse.xtext.junit4.ui.util.IResourcesSetupUtil.reallyWaitForAutoBuild()
org.eclipse.xtext.junit4.ui.util.IResourcesSetupUtil.waitForBuild(IProgressMonitor)


I hope it helps.
Re: Detecting the end of validation? [message #1736683 is a reply to message #1736615] Fri, 01 July 2016 07:25 Go to previous messageGo to next message
Anton Kosyakov is currently offline Anton KosyakovFriend
Messages: 9
Registered: March 2016
Junior Member
@Larry why do you need to track resources? Did you have a look at IXtextBuilderParticipant? It's called after indexing and linking/validations phases with deltas for all resources affected by the build. As an alternative you can also subscribe to changes of IBuilderState, have a look at addListener method.

Get professional support from the Xtext committers at www.typefox.io.
Re: Detecting the end of validation? [message #1736806 is a reply to message #1736683] Sat, 02 July 2016 00:26 Go to previous message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 124
Registered: October 2015
Senior Member
Great, thanks for the hooks! I'll look into all of your suggestions.

My language has unfortunately complex cross-referencing where one "method call" can refer to many "methods". (one-to-many). At runtime, the potential-matching methods are all placed in a list and the actual method to run is chosen procedurally (based on system state and possibly randomness).

So, because of this, I need to do my own tracking of cross-references and affected resources, to make sure everything is properly rebuilt when needed. If there's another way, I'm all ears!
Previous Topic:xtext editor hanging for long time
Next Topic:Xtext Dependencies for RCP Applications
Goto Forum:
  


Current Time: Mon May 13 20:21:40 GMT 2024

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

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

Back to the top