CppEditor: add default RefactoringEngine

..and use it when we don't have refactoring plug-in

Change-Id: Ibe317a9728d439b9c5e05271d92a330d22eaacb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-08-03 14:13:42 +02:00
parent 62ada96091
commit 76d12dc2d5
14 changed files with 226 additions and 83 deletions

View File

@@ -86,14 +86,16 @@ TEST_F(RefactoringEngine, SendRequestSourceLocationsForRenamingMessage)
EXPECT_CALL(mockRefactoringServer, requestSourceLocationsForRenamingMessage(message))
.Times(1);
engine.startLocalRenaming(cursor, filePath, textDocument.revision(), projectPart.data(), {});
engine.startLocalRenaming(CppTools::CursorInEditor{cursor, filePath},
projectPart.data(), {});
}
TEST_F(RefactoringEngine, AfterSendRequestSourceLocationsForRenamingMessageIsUnusable)
{
EXPECT_CALL(mockRefactoringServer, requestSourceLocationsForRenamingMessage(_));
engine.startLocalRenaming(cursor, filePath, textDocument.revision(), projectPart.data(), {});
engine.startLocalRenaming(CppTools::CursorInEditor{cursor, filePath},
projectPart.data(), {});
ASSERT_FALSE(engine.isUsable());
}