private static int getInlaysBeforeCaretWithComma(@NotNull Editor editor) {
    Caret caret = editor.getCaretModel().getCurrentCaret();
    int caretOffset = caret.getOffset();
    ParameterHintsPresentationManager pm = ParameterHintsPresentationManager.getInstance();
    List<Inlay<?>> inlays = pm.getParameterHintsInRange(editor, caretOffset, caretOffset);
    if (inlays.isEmpty()) {
      return 0;
    }

    VisualPosition caretPosition = caret.getVisualPosition();
    return ContainerUtil.count(inlays, inlay -> StringUtil.startsWithChar(pm.getHintText(inlay), ',') &&
                                                caretPosition.after(inlay.getVisualPosition()));
  }
private static int getInlaysBeforeCaretWithComma(@NotNull Editor editor)