@Nullable
  public static @NlsActions.ActionText String getActionName(@NotNull DataContext dataContext) {
    Editor editor = dataContext.getData(CommonDataKeys.EDITOR);
    if (editor != null) {
      Project project = dataContext.getData(CommonDataKeys.PROJECT);
      if (project == null) return null;
      PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
      if (file == null) return null;
      PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
      if (element == null) element = file;

      PsiReference reference = TargetElementUtilBase.findReferenceWithoutExpectedCaret(editor);
      if (reference != null) {
        PsiElement refElement = reference.resolve();
        if (refElement != null) {
          MoveHandlerDelegate refDelegate = findDelegate(new PsiElement[]{refElement}, null, reference);
          if (refDelegate != null) {
            return refDelegate.getActionName(new PsiElement[] { refElement });
          }
        }
      }

      // invoke() uses regular findElementAtCaret() instead of BaseRefactoringAction.getElementAtCaret(), match it
      List<MoveHandlerDelegate> candidateHandlers = findHandlersForLanguage(element);
      while (element != null) {
        PsiElement[] elementArray = {element};
        for (MoveHandlerDelegate handler : candidateHandlers) {
          if (handler.canMove(elementArray, null, reference)) {
            return handler.getActionName(elementArray);
          }
        }
        element = element.getParent();
      }
      return null;
    }

    PsiElement[] elements = BaseRefactoringAction.getPsiElementArray(dataContext);
    List<MoveHandlerDelegate> delegates = MoveHandlerDelegate.EP_NAME.getExtensionList();
    for(MoveHandlerDelegate delegate: delegates) {
      if (delegate.canMove(elements, null, null)) return delegate.getActionName(elements);
    }

    return null;
  }
@Nullable
  public static @NlsActions.ActionText String getActionName(@NotNull DataContext dataContext)