CrossRef Serialization of updated models [message #1450333] |
Wed, 22 October 2014 10:37 |
Cedric Brun Messages: 431 Registered: July 2009 |
Senior Member |
|
|
First a bit of background. I'm using Sirius with Xtext resources having cross references. When doing some editing in Sirius the ResourceSet is kept consistent, all the Xtext resources are resolved and loaded.
Now when I rename an element which had a cross-ref going to it and the resource is getting saved, the "old" name is still used, effectively breaking the model.
I understand this is because this name is retrieved from the index and not from the model itself, but in my case I think I would need to :
- either change that behavior and have a way to tell to the XtextResource : don't even bother asking the index and use the model instance itself. If possible in a DSL agnostic way ( meaning I can configure Xtext do to that for all the XtextResources by default.)
- update the index or "shadow" it based on my in memory state
- some other solution I could not figure out yet.
I've browsed through a lot of code and examples which *seems* to be related, or could be useful :
ResourceSetBasedResourceDescriptions, ResourceDescriptionsProvider.LIVE_SCOPE but it doesn't look like its getting called during the serialization
What would be the best course of action ?
http://cedric.brun.io news and articles on eclipse and eclipse modeling.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02455 seconds