List<AnAction> (PsiFile file, Project project, Editor editor) { Comparator<IntentionAction> comparator = Comparator.comparing((IntentionAction action) -> action instanceof PriorityAction ? ((PriorityAction)action).getPriority() : PriorityAction.Priority.NORMAL) .thenComparing(IntentionAction::getText); return IntentionManager.getInstance().getAvailableIntentions().stream() .map(IntentionActionDelegate::unwrap) .filter(action -> shouldShowInGutterPopup(action) && action.isAvailable(project, editor, file)) .sorted(comparator) .map(action -> new ApplyIntentionAction(action, action.getText(), editor, file)) .collect(Collectors.toList()); }