void (@NotNull Pair<PyCallExpression, PyCallableType> callAndCallee, @NotNull ParameterInfoUIContext context) { final int currentParamOffset = context.getCurrentParameterIndex(); // in Python mode, we get an offset here, not an index! ParameterHints parameterHints = PyParameterInfoUtils.buildParameterHints(callAndCallee, currentParamOffset); if (parameterHints == null) return; String[] hints = ArrayUtilRt.toStringArray(parameterHints.getHints()); String[] annotations = ArrayUtilRt.toStringArray(parameterHints.getAnnotations()); if (context instanceof ParameterInfoUIContextEx) { //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); if (!curFlags.contains(ParameterFlag.HIGHLIGHT) && i < hints.length && hints[i].length() > MY_PARAM_LENGTH_LIMIT && i < annotations.length) { String annotation = annotations[i]; if (!annotation.isEmpty() && annotation.length() < hints[i].length()) { hints[i] = annotation; } } flags[i] = StreamEx.of(parameterHints.getFlags().get(i)) .map(PARAM_FLAG_TO_UI_FLAG::get) .collect(MoreCollectors.toEnumSet(ParameterInfoUIContextEx.Flag.class)); } if (hints.length == 0) { hints = new String[]{getNoParamsMsg()}; //noinspection unchecked flags = new EnumSet[]{EnumSet.of(ParameterInfoUIContextEx.Flag.DISABLE)}; } ((ParameterInfoUIContextEx)context).setupUIComponentPresentation(hints, flags, context.getDefaultParameterColor()); } else { // fallback, no highlight final StringBuilder signatureBuilder = new StringBuilder(); if (hints.length == 0) { signatureBuilder.append(getNoParamsMsg()); } else { for (String s : hints) signatureBuilder.append(s); } context.setupUIComponentPresentation( signatureBuilder.toString(), -1, 0, false, false, false, context.getDefaultParameterColor() ); } }