Unnecessary local variable: provide "inline" QuickFix (IDEA-24780)

This commit is contained in:
Maxim Mossienko
2009-09-25 14:15:05 +04:00
parent 8aa0f299f7
commit 84be9b7337
@@ -55,15 +55,20 @@ public class InlineRefactoringActionHandler implements RefactoringActionHandler
}
}
final List<InlineHandler> handlers = InlineHandlers.getInlineHandlers(element.getLanguage());
for (InlineHandler handler : handlers) {
if (GenericInlineHandler.invoke(element, editor, handler)) {
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, REFACTORING_NAME, null);
}
}
public static boolean invokeInliner(Editor editor, PsiElement element) {
final List<InlineHandler> handlers = InlineHandlers.getInlineHandlers(element.getLanguage());
for (InlineHandler handler : handlers) {
if (GenericInlineHandler.invoke(element, editor, handler)) {
return true;
}
}
return false;
}
}