Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Invoke index rebuild programmatically
Invoke index rebuild programmatically [message #1705866] Wed, 19 August 2015 15:19 Go to next message
Stephan Hildebrandt is currently offline Stephan HildebrandtFriend
Messages: 25
Registered: July 2015
Junior Member
Hi,

I have the following problem: I have a model transformation written in Xtend that outputs two kinds of model files, say A and B. There is an Xtext editor for both kinds of models. Elements in B models have references to elements in A models. Everything works perfectly when I create and edit the models using the editors. However, when my model transformation creates multiple A and B models with cross references, the Xtext serializer complains that no EObjectDescription could be found in the scope. I presume the reason is, that the Xtext index is not updated in the meantime and, thus, contains no information about the newly generated A models. How can I solve this problem? I tried explicitly invoking a full rebuild on the project that contains the models after the A models have been written so that the Xtext builder could update the index before writing the B models. However, that did not help.


Best regards,

Stephan
Re: Invoke index rebuild programmatically [message #1705869 is a reply to message #1705866] Wed, 19 August 2015 15:56 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Stephan,

I assume you're generating the artifacts for A and B into the same
resource that contains your Xtend file?
Anyway: You should use a fresh resource set and configure the so called
live scope. All new resources need to be put into that resource set.
Saving should work afterwards without any issues.
Please try to inject the XtextLiveScopeResourceSetProvider and obtain
the a new resource set from that one.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Re: Invoke index rebuild programmatically [message #1705944 is a reply to message #1705869] Thu, 20 August 2015 10:18 Go to previous messageGo to next message
Stephan Hildebrandt is currently offline Stephan HildebrandtFriend
Messages: 25
Registered: July 2015
Junior Member
Hi Sebastian,

thank you. That works now. However, the performance of the model transformation is severely degraded, from a couple of seconds to about five minutes for a test model. I could improve the performance already considerably by adding the new elements during the transformation to a normal ResourceSetImpl first. After finishing the transformation, all resources are moved to a resource set provided by the XtextLiveScopeResourceSetProvider and then saved. However, saving the B models still takes a considerable amount of time. Are there any possibilities to improve the save performance?


Best regards,

Stephan
Re: Invoke index rebuild programmatically [message #1706027 is a reply to message #1705944] Fri, 21 August 2015 08:11 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
You could install ResourceDescriptionsData into the resource set. That
should improve the performance tremendously. See
ResourceDescriptionsData.ResourceSetAdapter.installResourceDescriptionsData(ResourceSet,
ResourceDescriptionsData).

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Re: Invoke index rebuild programmatically [message #1706039 is a reply to message #1706027] Fri, 21 August 2015 10:36 Go to previous message
Stephan Hildebrandt is currently offline Stephan HildebrandtFriend
Messages: 25
Registered: July 2015
Junior Member
Thank you. That helped a lot.
Previous Topic:Is it possible to use formatter and formatter2 both in one project
Next Topic:Cannot inject IHyperlinkHelper in junit
Goto Forum:
  


Current Time: Tue Mar 19 04:03:41 GMT 2024

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

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

Back to the top