static HighlightInfo.Builder checkExpressionRequired(@NotNull PsiReferenceExpression expression,
                                               @NotNull JavaResolveResult resultForIncompleteCode, @NotNull PsiFile containingFile) {
    if (expression.getNextSibling() instanceof PsiErrorElement) return null;

    PsiElement resolved = resultForIncompleteCode.getElement();
    if (resolved == null || resolved instanceof PsiVariable) return null;

    PsiElement parent = expression.getParent();
    if (parent instanceof PsiReferenceExpression || parent instanceof PsiMethodCallExpression || parent instanceof PsiBreakStatement) {
      return null;
    }

    String description = JavaErrorBundle.message("expression.expected");
    HighlightInfo.Builder info =
      HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(description);
    UnresolvedReferenceQuickFixUpdater.getInstance(containingFile.getProject()).registerQuickFixesLater(expression, info);
    return info;
  }
static HighlightInfo.Builder checkExpressionRequired(@NotNull PsiReferenceExpression expression,
                                               @NotNull JavaResolveResult resultForIncompleteCode, @NotNull PsiFile containingFile)