use of org.apache.flex.compiler.tree.as.IExpressionNode in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptTextDocumentService method getFunctionCallNodeArgumentIndex.
private int getFunctionCallNodeArgumentIndex(IFunctionCallNode functionCallNode, IASNode offsetNode) {
if (offsetNode == functionCallNode.getArgumentsNode() && offsetNode.getChildCount() == 0) {
//there are no arguments yet
return 0;
}
int indexToFind = offsetNode.getAbsoluteEnd();
IExpressionNode[] argumentNodes = functionCallNode.getArgumentNodes();
for (int i = argumentNodes.length - 1; i >= 0; i--) {
IExpressionNode argumentNode = argumentNodes[i];
if (indexToFind >= argumentNode.getAbsoluteStart()) {
return i;
}
}
return -1;
}
Aggregations