IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { final List<PsiClass> classes = getTargetClasses(); if (classes.size() == 0) { return IntentionPreviewInfo.EMPTY; } PsiClass targetClass = classes.get(0); final CreateFieldFix fix = new CreateFieldFix(targetClass); PsiField representation = fix.getFieldRepresentation(targetClass.getProject(), generateModifiers(targetClass), myReferenceName, getRefExpr(), true); PsiElement parent = representation == null ? null : representation.getParent(); if (parent == null) { return IntentionPreviewInfo.EMPTY; } return new IntentionPreviewInfo.CustomDiff(GroovyFileType.GROOVY_FILE_TYPE, "", parent.getText()); }