IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { PsiElement element = PsiTreeUtil.findSameElementInCopy(getStartElement(), file); if (!(element instanceof PsiNamedElement named)) return IntentionPreviewInfo.EMPTY; named.setName(myNewName); return IntentionPreviewInfo.DIFF; }