VariableTypeFix (@NotNull final PsiVariable variable, @NotNull final PsiType toReturn) { return new VariableTypeFix(variable, toReturn) { @NotNull @Override public String getText() { return TypeMigrationBundle.message("migrate.fix.text", myName, StringUtil.escapeXmlEntities(getReturnType().getPresentableText())); } @Override public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { // Avoid displaying the same diff as for VariableTypeFix, to avoid confusion. // TODO: add HTML description return IntentionPreviewInfo.EMPTY; } @Override public void invoke(@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { runTypeMigrationOnVariable((PsiVariable)startElement, getReturnType(), editor, false, true); } }; }