private function findActiveParameter(
        Node\DelimitedList\ArgumentExpressionList $argumentExpressionList,
        Position $position,
        PhpDocument $doc
    ): int {
        $args = $argumentExpressionList->children;
        $i = 0;
        $found = null;
        foreach ($args as $arg) {
            if ($arg instanceof Node) {
                $start = $arg->getFullStart();
                $end = $arg->getEndPosition();
            } else {
                $start = $arg->fullStart;
                $end = $start + $arg->length;
            }
            $offset = $position->toOffset($doc->getContent());
            if ($offset >= $start && $offset <= $end) {
                $found = $i;
                break;
            }
            if ($arg instanceof Node) {
                ++$i;
            }
        }
        if ($found === null) {
            $found = $i;
        }
        return $found;
    }