public static <V> int getCurrentParameterIndex(SyntaxTraverser<V> s, int offset, IElementType delimiterType) {
    V root = s.getRoot();
    int curOffset = s.api.rangeOf(root).getStartOffset();
    if (offset < curOffset) return -1;
    int index = 0;

    for (V child : s) {
      curOffset += s.api.rangeOf(child).getLength();
      if (offset < curOffset) break;

      IElementType type = s.api.typeOf(child);
      if (type == delimiterType) index++;
    }

    return index;
  }
public static <V> int getCurrentParameterIndex(SyntaxTraverser<V> s, int offset, IElementType delimiterType)