public static @NlsActions.ActionText String getName(@NotNull AnAction action) {
    String name = getTemplatePresentation(action).getText();
    if (StringUtil.isNotEmpty(name)) {
      return name;
    }

    @NlsSafe String id = ActionManager.getInstance().getId(action);
    if (id != null) {
      return id;
    }

    if (action instanceof DefaultActionGroup group) {
      if (group.getChildrenCount() == 0) return IdeBundle.message("action.empty.group.text");
      final AnAction[] children = group.getChildActionsOrStubs();
      for (AnAction child : children) {
        if (!(child instanceof Separator)) {
          return "group." + getName(child); //NON-NLS
        }
      }
      return IdeBundle.message("action.empty.unnamed.group.text");
    }
    return action.getClass().getName(); //NON-NLS
  }
public static @NlsActions.ActionText String getName(@NotNull AnAction action)