@Override
  protected void perform(@NotNull XDebugSession session, DataContext dataContext) {
    final Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
    if (editor == null) return;

    getTextToEvaluate(dataContext, session)
      .onSuccess(text -> {
        UIUtil.invokeLaterIfNeeded(() -> {
          XDebuggerWatchesManager watchesManager = ((XDebuggerManagerImpl)XDebuggerManager.getInstance(session.getProject())).getWatchesManager();
          XSourcePosition caretPosition = XDebuggerUtilImpl.getCaretPosition(session.getProject(), dataContext);
          if (text != null) {
            watchesManager.addInlineWatchExpression(XExpressionImpl.fromText(text), -1, caretPosition, false);
          } else if (caretPosition != null) {
            watchesManager.showInplaceEditor(caretPosition, editor, session, null);
          }
        });
      }).onError(e -> { });
  }
@Override
  protected void perform(@NotNull XDebugSession session, DataContext dataContext)