void (Document document, ULiteralExpression expression, List<? super FoldingDescriptor> result) { PsiElement sourcePsi = expression.getSourcePsi(); if (sourcePsi == null) return; if (!isI18nProperty(expression)) return; final IProperty property = getI18nProperty(expression); final HashSet<Object> set = new HashSet<>(); set.add(property != null ? property : PsiModificationTracker.MODIFICATION_COUNT); final String msg = formatI18nProperty(expression, property); final UElement parent = expression.getUastParent(); if (!msg.equals(UastLiteralUtils.getValueIfStringLiteral(expression)) && parent instanceof UCallExpression expressions && ((UCallExpression)parent).getValueArguments().get(0).getSourcePsi() == expression.getSourcePsi()) { PsiElement callSourcePsi = expressions.getSourcePsi(); if (callSourcePsi == null) return; final int count = JavaI18nUtil.getPropertyValueParamsMaxCount(expression); final List<UExpression> args = expressions.getValueArguments(); if (args.size() == 1 + count) { boolean ok = true; for (int i = 1; i < count + 1; i++) { Object value = args.get(i).evaluate(); if (value == null) { if (!(args.get(i) instanceof UReferenceExpression)) { ok = false; break; } } } if (ok) { UExpression receiver = expressions.getReceiver(); PsiElement receiverSourcePsi = receiver != null ? receiver.getSourcePsi() : null; PsiElement elementToFold = null; if (receiverSourcePsi != null) { elementToFold = PsiTreeUtil.findCommonParent(callSourcePsi, receiverSourcePsi); } if (elementToFold == null) { elementToFold = callSourcePsi; } result.add( new FoldingDescriptor(Objects.requireNonNull(elementToFold.getNode()), elementToFold.getTextRange(), null, formatMethodCallExpression(expressions), isFoldingsOn(), set)); if (property != null) { EditPropertyValueAction.registerFoldedElement(elementToFold, document); } return; } } else { return; } } result.add(new FoldingDescriptor(Objects.requireNonNull(sourcePsi.getNode()), sourcePsi.getTextRange(), null, getI18nMessage(expression), isFoldingsOn(), set)); if (property != null) { EditPropertyValueAction.registerFoldedElement(sourcePsi, document); } }