Community
Participate
Working Groups
Xtext can be used in combination with an existing Ecore model, in which EObjects may use EKeys to define a unique identifier. When renaming an object through a textual Xtext editor, currently the graphical Sirius information and references are lost. As the rest of the integration seems to work fine in the case of EKeys, it would be useful to add support for renaming objects with EKeys as well. The URI of an object without EKeys looks like my.statemachine#//@states.4 and with EKeys like my.statemachine#//@states[name='active']. In the case of EKeys, the renaming an object leads to a change in the URI of the object. See also the Xtext-Sirius presentation (https://www.eclipsecon.org/france2014/sites/default/files/slides/Xtext_Sirius.pdf) on slide 13. When renaming an element, Sirius is notified of a Resource change. In the notification Sirius gets a new URI and therefore adds a completely new object (it does not rename the old one). All references to the object in the diagrams are lost, including their settings (position, color etc) and even diagrams of that object. As described at https://www.eclipse.org/forums/index.php/t/1075680/, it seems not possible to add this functionality to the Xtext renaming implementation, because in this stage of the renaming process, the Sirius ResourceSet is not yet updated; the ResourceSet still identifies the object by its old URI.
Thanks for your enhancement submission. Could you give an example with reproduction scenario to reproduced problem? We agree that it would be an interesting improvement, but we have currently not planned to work on it in the following releases. That said this issue can move forward if you provide a fix for it or contact Obeo for sponsored work. Regards,