IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { final GrTypeDefinition containingClass = PsiTreeUtil.getParentOfType(myClass, GrTypeDefinition.class); PsiNamedElement target; if (containingClass != null) { target = containingClass; } else { target = myClass.getContainingFile(); } return IntentionPreviewInfo.movePsi(myClass, target); }