INode of unresolvable proxy EObjects [message #1745080] |
Tue, 04 October 2016 20:23 |
Mehmet Karaman Messages: 63 Registered: November 2012 Location: Berlin |
Member |
|
|
Hello,
is it possible to get the INode of an unresolvable element? NodeModelUtils.getNode(..) returns null. I've started iterating from the root Node and compared their semantic element with the proxy EObject, but their fragments differ:
- unresolvable objects fragment: #|4
- List<INode> feature = NodeModelUtils.findNodesForFeature(EObject, Feature): ... (gathered the Semantic Element) #//@nodes.0
So i can't match them, to find the corresponding INode. What is the appropriate way to achieve this? Thanks in advance.
Best regards
Mehmet
[Updated on: Tue, 04 October 2016 20:25] Report message to a moderator
|
|
|
|
Re: INode of unresolvable proxy EObjects [message #1745083 is a reply to message #1745081] |
Tue, 04 October 2016 21:16 |
|
of course you could do the same as the linking does
org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(String)
if (r instanceof LazyLinkingResource) {
LazyLinkingResource lazyLinkingResource = (LazyLinkingResource)r;
if (lazyLinkingResource.getEncoder().isCrossLinkFragment(lazyLinkingResource, eProxyURI.fragment())) {
Triple<EObject, EReference, INode> triple = lazyLinkingResource.getEncoder().decode(lazyLinkingResource, eProxyURI.fragment());
System.out.println(triple.getThird().getText());
}
}
but i doubt thats neccessary
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.03159 seconds