private static int findEndOfQuotedPlaceholder(@NotNull String pattern, int current) {
    if (!(current - 1 >= 0 && pattern.charAt(current - 1) == '\'')) {
      return -1;
    }
    String nextPattern = pattern.substring(current);
    int from = 0;
    int nextQuote;
    while (true) {
      nextQuote = nextPattern.indexOf('\'', from);
      if (nextQuote == -1) {
        return -1;
      }
      if (nextPattern.length() > nextQuote + 1 && nextPattern.charAt(nextQuote + 1) == '\'') {
        from = nextQuote + 2;
        continue;
      }
      break;
    }
    nextPattern = nextPattern.substring(0, nextQuote);
    if (nextPattern.startsWith("{") && nextPattern.endsWith("}") &&
        nextPattern.indexOf("}") == nextPattern.length() - 1) {
      MessageHolder holder = parseMessageHolder(nextPattern);
      if (holder.errors.isEmpty()) {
        List<MessageFormatPart> notStrings =
          ContainerUtil.filter(holder.parts, t -> !(t.getParsedType() == MessageFormatParsedType.STRING && t.getText().length() == 0));
        if (notStrings.size() == 1 && notStrings.get(0).getParsedType() == MessageFormatParsedType.FORMAT_ELEMENT) {
          return nextQuote + current;
        }
      }
    }
    return -1;
  }
private static int findEndOfQuotedPlaceholder(@NotNull String pattern, int current)