private static void asyncHighlightHints(@NotNull Editor editor,
                                          @Nullable PsiExpressionList expressionList,
                                          int currentHintIndex,
                                          @NotNull UserDataHolder context) {

    if (editor.isDisposed() || editor instanceof EditorWindow) return;
    ParameterHintsPresentationManager presentationManager = ParameterHintsPresentationManager.getInstance();
    Promise<HighlightedInlays> inlaysPromise = Promises.resolvedPromise(new HighlightedInlays(null, null));
    if (expressionList != null && expressionList.isValid()) {
      int expressionCount = expressionList.getExpressionCount();
      if (currentHintIndex == 0 || currentHintIndex > 0 && currentHintIndex < expressionCount) {
        SmartPsiElementPointer<PsiExpressionList> exprListPtr = SmartPointerManager.getInstance(expressionList.getProject())
          .createSmartPsiElementPointer(expressionList);
        inlaysPromise = ParameterHintsPass.asyncUpdate(expressionList.getParent(), editor)
          .then(__ -> collectInlaysToHighlight(editor, currentHintIndex, presentationManager, expressionCount, exprListPtr));
      }
    }
    inlaysPromise.onSuccess(inlays -> {
      List<Inlay<?>> highlightedHints = inlays.highlightedHints;
      Inlay<?> currentHint = inlays.currentHint;
      if (currentHint == context.getUserData(CURRENT_HINT) &&
          Objects.equals(highlightedHints, context.getUserData(HIGHLIGHTED_HINTS))) {
        return;
      }
      resetHints(context);
      if (currentHint != null) {
        presentationManager.setCurrent(currentHint, true);
        context.putUserData(CURRENT_HINT, currentHint);
      }
      if (!ContainerUtil.isEmpty(highlightedHints)) {
        for (Inlay<?> highlightedHint : highlightedHints) {
          presentationManager.setHighlighted(highlightedHint, true);
        }
        context.putUserData(HIGHLIGHTED_HINTS, highlightedHints);
      }
    });
  }
private static void asyncHighlightHints(@NotNull Editor editor,
                                          @Nullable PsiExpressionList expressionList,
                                          int currentHintIndex,
                                          @NotNull UserDataHolder context)