void (@NotNull final Project project, Editor editor, PsiFile file, DataContext dataContext) { editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext); if (element == null) { element = BaseRefactoringAction.getElementAtCaret(editor, file); } if (element != null) { for(InlineActionHandler handler: InlineActionHandler.EP_NAME.getExtensionList()) { if (handler.canInlineElementInEditor(element, editor)) { handler.inlineElement(project, editor, element); return; } } if (invokeInliner(editor, element)) return; String message = RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("error.wrong.caret.position.method.or.local.name")); CommonRefactoringUtil.showErrorHint(project, editor, message, getRefactoringName(), null); } }