Detecting the end of validation? [message #1735062] |
Wed, 15 June 2016 07:20  |
Eclipse User |
|
|
|
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] by Moderator 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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
@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.
|
|
|
Re: Detecting the end of validation? [message #1736806 is a reply to message #1736683] |
Sat, 02 July 2016 00:26  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.03600 seconds