void (@NotNull String id, @Nullable String asId, Shortcut @NotNull [] shortcuts, @NotNull StringBuilder dest) { if (shortcuts.length == 0) { return; } dest.append(LEVELS[1]).append("<Action id=\"").append(asId == null ? id : asId).append("\">\n"); // Different shortcuts may have equal display strings (e.g., shift+minus and shift+subtract) // We don't want them do be duplicated for users Arrays.stream(shortcuts) .map(shortcut -> KeymapUtil.getShortcutText(shortcut)) .distinct() .forEach(shortcut -> dest.append(LEVELS[2]).append("<Shortcut>").append(shortcut).append("</Shortcut>\n")); final AnAction action = ActionManager.getInstance().getAction(id); if (action != null) { final String text = action.getTemplatePresentation().getText(); if (text != null) { dest.append(LEVELS[2]).append("<Text>").append(StringUtil.escapeXmlEntities(text)).append("</Text>\n"); } } dest.append(LEVELS[1]).append("</Action>\n"); }