private static @NotNull Condition<AnAction> createActionFilter(@Nullable String filter, boolean force) {
    if (filter == null) return Conditions.alwaysTrue();

    ActionManager actionManager = ActionManager.getInstance();
    AbbreviationManager abbreviationManager = AbbreviationManager.getInstance();
    String insensitiveFilter = StringUtil.toLowerCase(filter);
    Condition<? super String> condition = text -> {
      String lowerText = text == null ? null : StringUtil.toLowerCase(text);
      return lowerText != null && (
             SearchUtil.isComponentHighlighted(lowerText, insensitiveFilter, force, null) ||
             lowerText.contains(insensitiveFilter));
    };

    return action -> {
      if (action == null) return false;

      Presentation presentation = getTemplatePresentation(action);
      if (condition.test(presentation.getText())) return true;
      if (condition.test(presentation.getDescription())) return true;

      for (Supplier<String> synonym : action.getSynonyms()) {
        if (condition.test(synonym.get())) return true;
      }

      String actionId = actionManager.getId(action);
      if (condition.test(actionId)) return true;
      Set<String> abbreviations = actionId == null ? Collections.emptySet() :
                                  abbreviationManager.getAbbreviations(actionId);
      for (String abbreviation : abbreviations) {
        if (condition.test(abbreviation)) return true;
      }

      return false;
    };
  }
private static @NotNull Condition<AnAction> createActionFilter(@Nullable String filter, boolean force)