use of com.intellij.refactoring.inline.InlineRefactoringActionHandler in project intellij-community by JetBrains.
the class DaemonRespondToChangesTest method testRehighlightInnerBlockAfterInline.
public void testRehighlightInnerBlockAfterInline() throws Exception {
configureByFile(BASE_PATH + getTestName(false) + ".java");
Collection<HighlightInfo> errors = highlightErrors();
HighlightInfo error = assertOneElement(errors);
assertEquals("Variable 'e' is already defined in the scope", error.getDescription());
PsiElement element = getFile().findElementAt(getEditor().getCaretModel().getOffset()).getParent();
DataContext dataContext = SimpleDataContext.getSimpleContext(CommonDataKeys.PSI_ELEMENT.getName(), element, ((EditorEx) getEditor()).getDataContext());
new InlineRefactoringActionHandler().invoke(getProject(), getEditor(), getFile(), dataContext);
Collection<HighlightInfo> afterTyping = highlightErrors();
assertEmpty(afterTyping);
}
use of com.intellij.refactoring.inline.InlineRefactoringActionHandler in project intellij-community by JetBrains.
the class InlineAction method getHandler.
@Override
protected RefactoringActionHandler getHandler(@NotNull Language language, PsiElement element) {
RefactoringActionHandler handler = super.getHandler(language, element);
if (handler != null)
return handler;
List<InlineHandler> handlers = InlineHandlers.getInlineHandlers(language);
return handlers.isEmpty() ? null : new InlineRefactoringActionHandler();
}
Aggregations