IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { PsiElement element = getElement(editor, file); if (element == null) return IntentionPreviewInfo.EMPTY; PsiType type = getTypeOfUnfilledParameter(editor, element); if (type != null) return new IntroduceEmptyVariableHandlerImpl().generatePreview(editor, element.getContainingFile(), type); final PsiExpression expression = detectExpressionStatement(element); if (expression == null) return IntentionPreviewInfo.EMPTY; RefactoringSupportProvider supportProvider = LanguageRefactoringSupport.INSTANCE.forLanguage(JavaLanguage.INSTANCE); JavaIntroduceVariableHandlerBase handler = (JavaIntroduceVariableHandlerBase)supportProvider.getIntroduceVariableHandler(); if (handler instanceof PreviewableRefactoringActionHandler previewableRefactoringActionHandler) { return previewableRefactoringActionHandler.generatePreview(project, expression); } return IntentionPreviewInfo.EMPTY; }