cp.appendNodeList("(", args, ", " , ")");
}
@Override
public Collection<INamedElement> findTargetDefElements(IModuleResolver moduleResolver, boolean findFirstOnly) {
INamedElement calleeElem = callee.findTargetDefElement(moduleResolver);
if(calleeElem == null)
return null;
if (calleeElem instanceof DefinitionFunction) {
DefinitionFunction defOpCallFunc = (DefinitionFunction) calleeElem;
INamedElement calleeResult = defOpCallFunc.findReturnTypeTargetDefUnit(moduleResolver);
return Collections.singleton(calleeResult);
}
Module moduleNode = null;
if(calleeElem instanceof ASTNode) {
ASTNode astNode = (ASTNode) calleeElem;
moduleNode = astNode.getModuleNode();
}
if(moduleNode == null) {
return null;
}
DefUnitSearch search = new DefUnitSearch("opCall", moduleNode, false, moduleResolver);
calleeElem.resolveSearchInMembersScope(search);
for (Iterator<INamedElement> iter = search.getMatchedElements().iterator(); iter.hasNext();) {
INamedElement defOpCall = iter.next();
if (defOpCall instanceof DefinitionFunction) {
DefinitionFunction defOpCallFunc = (DefinitionFunction) defOpCall;
INamedElement targetDefUnit = defOpCallFunc.findReturnTypeTargetDefUnit(moduleResolver);
return Collections.singleton(targetDefUnit);
}
}
return null;
}