String (@Nullable ActionContext context, CommonIntentionAction t) { if (t instanceof IntentionAction intention) { return intention.getText(); } if (!(t instanceof ModCommandAction action)) { throw new AssertionError("Action is not ModCommandAction: " + t); } if (context == null) { fail("Context is not specified for ModCommandAction"); } Presentation presentation = action.getPresentation(context); return presentation == null ? "(unavailable) " + action.getFamilyName() : presentation.name(); }