Clang: Remove old code

We maybe bring back the clang query interface but the local rename is
better served by other plugins.

Change-Id: I97bedcb20870632b7dd50977794a65b2b09ededb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2019-07-03 17:57:43 +02:00
parent f864c7a0d8
commit 376aae2711
40 changed files with 5 additions and 1624 deletions

View File

@@ -107,46 +107,11 @@ protected:
ProjectExplorer::Project project;
CppTools::ProjectPart::Ptr projectPart;
CppTools::ProjectFile projectFile{qStringFilePath, CppTools::ProjectFile::CXXSource};
SourceLocationsForRenamingMessage renameMessage{"symbol",
{{{42, 1, 1, 0}, {42, 2, 5, 10}}},
1};
SourceRangesForQueryMessage queryResultMessage{{{{42, 1, 1, 0, 1, 5, 4, ""},
{42, 2, 1, 5, 2, 5, 10, ""}}}};
SourceRangesForQueryMessage emptyQueryResultMessage;
};
TEST_F(RefactoringClient, SourceLocationsForRenaming)
{
client.setLocalRenamingCallback(mockLocalRenaming.AsStdFunction());
EXPECT_CALL(mockLocalRenaming, Call(renameMessage.symbolName.toQString(),
renameMessage.sourceLocations,
renameMessage.textDocumentRevision));
client.sourceLocationsForRenamingMessage(std::move(renameMessage));
}
TEST_F(RefactoringClient, AfterSourceLocationsForRenamingEngineIsUsableAgain)
{
client.setLocalRenamingCallback(mockLocalRenaming.AsStdFunction());
EXPECT_CALL(mockLocalRenaming, Call(_,_,_));
client.sourceLocationsForRenamingMessage(std::move(renameMessage));
ASSERT_TRUE(engine.isRefactoringEngineAvailable());
}
TEST_F(RefactoringClient, AfterStartLocalRenameHasValidCallback)
{
engine.startLocalRenaming(CppTools::CursorInEditor{cursor, filePath},
projectPart.data(),
[&] (const QString &,
const ClangBackEnd::SourceLocationsContainer &,
int) {});
ASSERT_TRUE(client.hasValidLocalRenamingCallback());
}
TEST_F(RefactoringClient, CallAddResultsForEmptyQueryMessage)
{
EXPECT_CALL(mockSearchHandle, addResult(_ ,_ ,_))