Search in sources :

Example 1 with ServerRenameRefactoring

use of com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring in project intellij-plugins by JetBrains.

the class DartServerRenameTest method doTest.

private void doTest(@NotNull final String newName) {
    final ServerRenameRefactoring refactoring = createRenameRefactoring();
    doTest(refactoring, newName);
}
Also used : ServerRenameRefactoring(com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring)

Example 2 with ServerRenameRefactoring

use of com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring in project intellij-plugins by JetBrains.

the class DartServerRenameTest method testCheckInitialConditionsCannotCreate.

public void testCheckInitialConditionsCannotCreate() throws Throwable {
    final ServerRenameRefactoring refactoring = createRenameRefactoring();
    final RefactoringStatus initialConditions = refactoring.checkInitialConditions();
    assertNotNull(initialConditions);
    assertTrue(initialConditions.hasFatalError());
}
Also used : RefactoringStatus(com.jetbrains.lang.dart.ide.refactoring.status.RefactoringStatus) ServerRenameRefactoring(com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring)

Example 3 with ServerRenameRefactoring

use of com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring in project intellij-plugins by JetBrains.

the class DartServerRenameTest method testCheckFinalConditionsNameFatalError.

public void testCheckFinalConditionsNameFatalError() throws Throwable {
    final ServerRenameRefactoring refactoring = createRenameRefactoring();
    // initial status OK
    final RefactoringStatus initialConditions = refactoring.checkInitialConditions();
    assertNotNull(initialConditions);
    assertTrue(initialConditions.isOK());
    // final (actually options) status has a fatal error
    refactoring.setNewName("bad name");
    final RefactoringStatus finalConditions = refactoring.checkFinalConditions();
    assertNotNull(finalConditions);
    assertTrue(finalConditions.hasFatalError());
}
Also used : RefactoringStatus(com.jetbrains.lang.dart.ide.refactoring.status.RefactoringStatus) ServerRenameRefactoring(com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring)

Example 4 with ServerRenameRefactoring

use of com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring in project intellij-plugins by JetBrains.

the class DartServerRenameTest method testTypeAndImmediatelyRenameLocalVar.

public void testTypeAndImmediatelyRenameLocalVar() throws Throwable {
    myFixture.configureByFile(getTestName(false) + ".dart");
    // warm up
    myFixture.doHighlighting();
    myFixture.type('\n');
    final int offset = getEditor().getCaretModel().getOffset();
    final ServerRenameRefactoring refactoring = new ServerRenameRefactoring(getProject(), getFile().getVirtualFile(), offset, 0);
    doTest(refactoring, "newName");
}
Also used : ServerRenameRefactoring(com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring)

Aggregations

ServerRenameRefactoring (com.jetbrains.lang.dart.ide.refactoring.ServerRenameRefactoring)4 RefactoringStatus (com.jetbrains.lang.dart.ide.refactoring.status.RefactoringStatus)2