use of com.jetbrains.lang.dart.ide.refactoring.introduce.DartIntroduceHandler in project intellij-plugins by JetBrains.
the class DartIntroduceTestBase method doTestInplace.
protected void doTestInplace(@Nullable Consumer<DartIntroduceOperation> customization) {
String name = getTestName(false);
myFixture.configureByFile(name + getFileExtension());
final boolean enabled = myFixture.getEditor().getSettings().isVariableInplaceRenameEnabled();
try {
TemplateManagerImpl.setTemplateTesting(getProject(), myFixture.getTestRootDisposable());
myFixture.getEditor().getSettings().setVariableInplaceRenameEnabled(true);
DartIntroduceHandler handler = createHandler();
final DartIntroduceOperation introduceOperation = new DartIntroduceOperation(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile(), "a");
introduceOperation.setReplaceAll(true);
if (customization != null) {
customization.consume(introduceOperation);
}
handler.performAction(introduceOperation);
TemplateState state = TemplateManagerImpl.getTemplateState(myFixture.getEditor());
assert state != null;
state.gotoEnd(false);
myFixture.checkResultByFile(name + ".after" + getFileExtension(), true);
} finally {
myFixture.getEditor().getSettings().setVariableInplaceRenameEnabled(enabled);
}
}
use of com.jetbrains.lang.dart.ide.refactoring.introduce.DartIntroduceHandler in project intellij-plugins by JetBrains.
the class DartIntroduceTestBase method doTest.
protected void doTest(@Nullable Consumer<DartIntroduceOperation> customization, boolean replaceAll) {
myFixture.configureByFile(getTestName(false) + getFileExtension());
boolean inplaceEnabled = myFixture.getEditor().getSettings().isVariableInplaceRenameEnabled();
try {
myFixture.getEditor().getSettings().setVariableInplaceRenameEnabled(false);
DartIntroduceHandler handler = createHandler();
final DartIntroduceOperation operation = new DartIntroduceOperation(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile(), "foo");
operation.setReplaceAll(replaceAll);
if (customization != null) {
customization.consume(operation);
}
handler.performAction(operation);
doCheck();
} finally {
myFixture.getEditor().getSettings().setVariableInplaceRenameEnabled(inplaceEnabled);
}
}
Aggregations