private static <V extends XSmartStepIntoVariant> void inplaceChoose(XSmartStepIntoHandler<V> handler,
                                                                      List<? extends V> variants,
                                                                      XDebugSession session,
                                                                      Editor editor) {
    HighlightManager highlightManager = HighlightManager.getInstance(session.getProject());

    SmartStepData<V> data = new SmartStepData<>(handler, variants, session, editor);

    EditorHyperlinkSupport hyperlinkSupport = EditorHyperlinkSupport.get(editor);
    for (SmartStepData<V>.VariantInfo info : data.myVariants) {
      TextRange range = info.myVariant.getHighlightRange();
      if (range != null) {
        List<RangeHighlighter> highlighters = new SmartList<>();
        highlightManager.addOccurrenceHighlight(editor, range.getStartOffset(), range.getEndOffset(), DebuggerColors.SMART_STEP_INTO_TARGET,
                                                HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_TEXT_CHANGE, highlighters);
        RangeHighlighter highlighter = highlighters.get(0);
        hyperlinkSupport.createHyperlink(highlighter, project -> data.stepInto(info));
        data.myHighlighters.add(highlighter);
      }
    }

    data.myVariants.stream().filter(v -> v.myVariant == variants.get(0)).findFirst().ifPresent(data::select);
    LOG.assertTrue(data.myCurrentVariant != null);
    editor.putUserData(SMART_STEP_INPLACE_DATA, data);
    // for the remote development scenario we have to add a fake invisible highlighter on the whole document with extra payload
    // that will be restored on the client and used to alternate actions availability
    // see com.intellij.openapi.editor.ex.util.EditorActionAvailabilityHintKt.addActionAvailabilityHint
    ((MarkupModelEx)editor.getMarkupModel()).addRangeHighlighterAndChangeAttributes(HighlighterColors.NO_HIGHLIGHTING, 0, editor.getDocument().getTextLength(),
                                                                                    HighlighterLayer.LAST, HighlighterTargetArea.EXACT_RANGE, false, h -> {
      // this hints should be added in this lambda in order to be serialized by RD markup machinery
      EditorActionAvailabilityHintKt.addActionAvailabilityHint(h,
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_ENTER, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside),
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_TAB, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside),
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_ESCAPE, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside),
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_MOVE_CARET_UP, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside),
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside),
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside),
                                                               new EditorActionAvailabilityHint(IdeActions.ACTION_EDITOR_MOVE_CARET_LEFT, EditorActionAvailabilityHint.AvailabilityCondition.CaretInside));
      data.myActionHintSyntheticHighlighter = h;
    });

    session.updateExecutionPosition();
    if (AppMode.isRemoteDevHost()) {
      VirtualFile virtualFile = editor.getVirtualFile();
      // in the case of remote development the ordinary focus request doesn't work, we need to use FileEditorManagerEx api to focus the editor
      if (virtualFile != null) {
        FileEditorManagerEx.getInstanceEx(session.getProject()).openFile(virtualFile, true, true);
      }
    }
    IdeFocusManager.getGlobalInstance().requestFocus(editor.getContentComponent(), true);
    showInfoHint(editor, data);

    session.addSessionListener(new XDebugSessionListener() {
      void onAnyEvent() {
        session.removeSessionListener(this);
        UIUtil.invokeLaterIfNeeded(() -> {
          SmartStepData stepData = editor.getUserData(SMART_STEP_INPLACE_DATA);
          if (stepData != null) {
            stepData.clear();
          }
        });
      }

      @Override
      public void sessionPaused() {
        onAnyEvent();
      }

      @Override
      public void sessionResumed() {
        onAnyEvent();
      }

      @Override
      public void sessionStopped() {
        onAnyEvent();
      }

      @Override
      public void stackFrameChanged() {
        onAnyEvent();
      }

      @Override
      public void settingsChanged() {
        onAnyEvent();
      }
    });
 }
private static <V extends XSmartStepIntoVariant> void inplaceChoose(XSmartStepIntoHandler<V> handler,
                                                                      List<? extends V> variants,
                                                                      XDebugSession session,
                                                                      Editor editor)