Package com.jetbrains.lang.dart.ide.refactoring.introduce

Examples of com.jetbrains.lang.dart.ide.refactoring.introduce.DartIntroduceHandler


    }
  }

  protected Collection<String> buildSuggestions(Class<? extends DartExpression> parentClass) {
    myFixture.configureByFile(getTestName(false) + getFileExtension());
    DartIntroduceHandler handler = createHandler();
    DartExpression expr = PsiTreeUtil.getParentOfType(
      myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset()),
      parentClass
    );
    return DartNameSuggesterUtil.getSuggestedNames(expr);
View Full Code Here


  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);
    }
View Full Code Here

    final boolean enabled = myFixture.getEditor().getSettings().isVariableInplaceRenameEnabled();
    try {
      TemplateManagerImpl.setTemplateTesting(getProject(), 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);
View Full Code Here

TOP

Related Classes of com.jetbrains.lang.dart.ide.refactoring.introduce.DartIntroduceHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.