IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { String originalText = file.getText(); final Runnable optimize = new GroovyImportOptimizer().processFile(file); optimize.run(); String newText = file.getText(); return new IntentionPreviewInfo.CustomDiff(GroovyFileType.GROOVY_FILE_TYPE, originalText, newText); }