Condition<AnAction> (final @Nullable Condition<? super AnAction> filter, final Keymap keymap, final ActionManager actionManager) { final ActionShortcutRestrictions shortcutRestrictions = ActionShortcutRestrictions.getInstance(); return action -> { if (action == null) return false; final String id = actionManager.getId(action); if (id != null) { if (!Registry.is("keymap.show.alias.actions")) { String binding = KeymapManagerEx.getInstanceEx().getActionBinding(id); boolean bound = binding != null && actionManager.getAction(binding) != null // do not hide bound action, that miss the 'bound-with' && !hasAssociatedShortcutsInHierarchy(id, keymap); // do not hide bound actions when they are redefined if (bound) { return false; } } if (!shortcutRestrictions.getForActionId(id).allowChanging) { return false; } } return filter == null || filter.value(action); }; }