use of org.eclipse.xtext.xbase.typesystem.computation.IConstructorLinkingCandidate in project xtext-xtend by eclipse.
the class XtendHyperlinkHelper method createHyperlinksForCrossRef.
@Override
protected void createHyperlinksForCrossRef(XtextResource resource, INode crossRefNode, IHyperlinkAcceptor acceptor) {
EObject crossLinkedEObject = getEObjectAtOffsetHelper().getCrossReferencedElement(crossRefNode);
if (crossLinkedEObject != null && !crossLinkedEObject.eIsProxy()) {
EObject containedElementAt = getEObjectAtOffsetHelper().resolveContainedElementAt(resource, crossRefNode.getOffset());
if (containedElementAt instanceof XAbstractFeatureCall) {
XAbstractFeatureCall casted = (XAbstractFeatureCall) containedElementAt;
if (casted.getFeature() == crossLinkedEObject) {
IFeatureLinkingCandidate candidate = getBatchTypeResolver().resolveTypes(casted).getLinkingCandidate(casted);
if (candidate instanceof IAmbiguousLinkingCandidate) {
createMultipleLinks(resource, crossRefNode, ((IAmbiguousLinkingCandidate) candidate).getAlternatives(), acceptor);
} else if (candidate instanceof ISuspiciouslyOverloadedCandidate) {
ISuspiciouslyOverloadedCandidate castedCandidate = (ISuspiciouslyOverloadedCandidate) candidate;
createMultipleLinks(resource, crossRefNode, Lists.newArrayList(castedCandidate.getChosenCandidate(), castedCandidate.getRejectedCandidate()), acceptor);
}
}
} else if (containedElementAt instanceof XConstructorCall) {
XConstructorCall casted = (XConstructorCall) containedElementAt;
if (casted.getConstructor() == crossLinkedEObject) {
IConstructorLinkingCandidate candidate = getBatchTypeResolver().resolveTypes(casted).getLinkingCandidate(casted);
if (candidate instanceof IAmbiguousLinkingCandidate) {
createMultipleLinks(resource, crossRefNode, ((IAmbiguousLinkingCandidate) candidate).getAlternatives(), acceptor);
}
}
}
}
super.createHyperlinksForCrossRef(resource, crossRefNode, acceptor);
}
Aggregations