MessageFormatResult (@NotNull String pattern) { if (pattern.isEmpty()) { return new MessageFormatResult(true, List.of(), List.of()); } MessageHolder holder = parseMessageHolder(pattern); List<MessageFormatError> errors = holder.getErrors(); List<MessageFormatPart> parts = holder.getParts(); for (MessageFormatPart part : parts) { if (part.getParsedType() == MessageFormatParsedType.STRING) { String string = part.getText(); List<MessageFormatError> doubleQuoteErrors = checkQuote(string); //rearrange quote errors, because quotes can be merged errors.addAll(rearrangeErrors(doubleQuoteErrors, pattern, string, part.start)); } } List<MessageFormatPlaceholder> placeholderIndexes = new ArrayList<>(); for (MessageFormatPart part : parts) { if (part.getParsedType() == MessageFormatParsedType.FORMAT_ELEMENT && part.getMessageFormatElement() != null && part.getMessageFormatElement().getIndex() != null) { placeholderIndexes.add(new MessageFormatPlaceholder(part.getMessageFormatElement().getIndex())); } } return new MessageFormatResult(errors.isEmpty(), errors, placeholderIndexes); }