use of org.eclipse.xtext.scoping.IScope in project coffeescript-eclipse by adamschmideg.
the class LinkingServiceWithNode method getLinkedObjects.
/**
* Basically a copy of super, only linkNode is remembered before calling getScope
*/
public List<EObject> getLinkedObjects(EObject context, EReference ref, INode node) throws IllegalNodeException {
final EClass requiredType = ref.getEReferenceType();
if (requiredType == null)
return Collections.<EObject>emptyList();
final String crossRefString = getCrossRefNodeAsString(node);
if (crossRefString != null && !crossRefString.equals("")) {
linkNode = node;
final IScope scope = getScope(context, ref);
linkNode = null;
QualifiedName qualifiedLinkName = qualifiedNameConverter.toQualifiedName(crossRefString);
IEObjectDescription eObjectDescription = scope.getSingleElement(qualifiedLinkName);
if (eObjectDescription != null)
return Collections.singletonList(eObjectDescription.getEObjectOrProxy());
}
return Collections.emptyList();
}
Aggregations