Community
Participate
Working Groups
The current CrossReferenceSerializer implementation attempts to return ITokenSerializer.KEEP_VALUE_FROM_NODE_MODEL if the reference already references the *same* object as determined by the linking service. The currently referenced object will however be a resolved object (provided it *could* be resolved) and the linking service will in many cases return a corresponding proxy object. As a result the comparison fails and the cross reference serializer does not keep the value from the node model. The CrossReferenceSerializer should in serializeCrossRef() also check whether any of the objects returned by the linking service has a URI matching that of the currently referenced object.
Created attachment 179251 [details] suggested patch Attached a patch implementing solution mentioned in description. Please review.
*** Bug 347419 has been marked as a duplicate of this bug. ***
I assume a test case is easy to write if the linking service is decorated and returns proxies instead of real objects for local objects?
Created attachment 201515 [details] patch including unit test The attached patch now includes a unit test. Note that the patch only fixes the old serializer. The API of the new CrossReferenceSerializer doesn't have an INode parameter so I don't know how this patch could be applied there.
To me it looks like this issue is already addressed by the new serializer. It doesn't use the ILinkingService directly anymore but instead the IScopeProvider. I think that seems reasonable although it may not work for languages like Xtext which implement some special logic in the ILinkingService for certain references.
Knut, could you please apply the patch for the old serializer?
Fix pushed to master.
Closing all bugs that were set to RESOLVED before Neon.0