List<TemplateImpl> (@NotNull TemplateActionContext templateActionContext) { Set<TemplateContextType> contextTypes = getApplicableContextTypes(templateActionContext); final ArrayList<TemplateImpl> result = new ArrayList<>(); for (final TemplateImpl template : TemplateSettings.getInstance().getTemplates()) { if (!template.isDeactivated() && (!templateActionContext.isSurrounding() || template.isSelectionTemplate()) && isApplicable(template, contextTypes)) { result.add(template); } } return result; }