void (@NotNull ActionGroup actionGroup, @NotNull Collection<? super AnAction> out) { AnAction[] actions = actionGroup.getChildren(null); for (AnAction childAction : actions) { if (childAction == null) { continue; } if (childAction instanceof ActionGroup childGroup) { collectLeafActions(childGroup, out); continue; } if (childAction instanceof Separator) { continue; } out.add(childAction); } }