@Override
  public void updateUI(@NotNull PyParameterInfoUtils.CallInfo description,
                       @NotNull ParameterInfoUIContext context) {
    context.setUIComponentVisible(description.isVisible());
    final int currentParamOffset = context.getCurrentParameterIndex(); // in Python mode, we get an offset here, not an index!
    ParameterHints parameterHints = PyParameterInfoUtils.buildParameterHints(description.getCallandCalleePair(), currentParamOffset);
    if (parameterHints == null) return;

    boolean showAllHints = Registry.is("python.parameter.info.show.all.hints");
    List<PyParameterInfoUtils.ParameterDescription> parameterDescriptions = parameterHints.getParameterDescriptors();
    String[] hintsToShow = new String[parameterDescriptions.size()];
    //noinspection unchecked
    EnumSet<ParameterInfoUIContextEx.Flag>[] flags = new EnumSet[parameterHints.getFlags().size()];
    for (int i = 0; i < flags.length; i++) {
      EnumSet<ParameterFlag> curFlags = parameterHints.getFlags().get(i);
      PyParameterInfoUtils.ParameterDescription representation = parameterDescriptions.get(i);
      hintsToShow[i] = getRepresentationToShow(representation, curFlags.contains(ParameterFlag.HIGHLIGHT), showAllHints);
      flags[i] = StreamEx.of(parameterHints.getFlags().get(i))
        .map(PARAM_FLAG_TO_UI_FLAG::get)
        .collect(MoreCollectors.toEnumSet(ParameterInfoUIContextEx.Flag.class));
    }
    if (context instanceof ParameterInfoUIContextEx) {
      if (parameterDescriptions.isEmpty()) {
        hintsToShow = new String[]{getNoParamsMsg()};
        //noinspection unchecked
        flags = new EnumSet[]{EnumSet.of(ParameterInfoUIContextEx.Flag.DISABLE)};
      }
      ((ParameterInfoUIContextEx)context).setupUIComponentPresentation(hintsToShow, flags, context.getDefaultParameterColor());
    }
    else { // fallback, no highlight
      final StringBuilder signatureBuilder = new StringBuilder();
      if (hintsToShow.length == 0) {
        signatureBuilder.append(getNoParamsMsg());
      }
      else {
        for (String s : hintsToShow) signatureBuilder.append(s);
      }
      context.setupUIComponentPresentation(
        signatureBuilder.toString(), -1, 0, false, false, false, context.getDefaultParameterColor()
      );
    }
  }
@Override
  public void updateUI(@NotNull PyParameterInfoUtils.CallInfo description,
                       @NotNull ParameterInfoUIContext context)