void (@NotNull final Project project, final Editor editor, PsiFile file, DataContext dataContext) { PsiElement element = TargetElementUtil.findTargetElement(editor, TargetElementUtil .ELEMENT_NAME_ACCEPTED | TargetElementUtil .LOOKUP_ITEM_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); if (!(element instanceof PsiLocalVariable)) { String message = RefactoringBundle.getCannotRefactorMessage(JavaRareRefactoringsBundle.message("error.wrong.caret.position.local.name")); CommonRefactoringUtil.showErrorHint(project, editor, message, getRefactoringName(), HelpID.REPLACE_TEMP_WITH_QUERY); return; } invokeOnVariable(file, project, (PsiLocalVariable)element, editor); }