summaryrefslogtreecommitdiff
path: root/src/plugins/clangrefactoring
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-07-03 17:57:43 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-07-04 08:41:10 +0000
commit376aae271132b39664d381f00bdcd45856acbd73 (patch)
tree7275d4d96b2005857e0df1c66ef9b5a45ea326b1 /src/plugins/clangrefactoring
parentf864c7a0d8e0da6ee41c3fede96af06db1cc08b9 (diff)
downloadqt-creator-376aae271132b39664d381f00bdcd45856acbd73.tar.gz
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>
Diffstat (limited to 'src/plugins/clangrefactoring')
-rw-r--r--src/plugins/clangrefactoring/clangrefactoringplugin.cpp6
-rw-r--r--src/plugins/clangrefactoring/refactoringclient.cpp21
-rw-r--r--src/plugins/clangrefactoring/refactoringclient.h7
-rw-r--r--src/plugins/clangrefactoring/refactoringengine.cpp32
4 files changed, 3 insertions, 63 deletions
diff --git a/src/plugins/clangrefactoring/clangrefactoringplugin.cpp b/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
index 059eff4c78..d33e4e2b88 100644
--- a/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
+++ b/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
@@ -96,10 +96,6 @@ public:
SymbolQuery<QuerySqliteReadStatementFactory> symbolQuery{statementFactory};
ClangBackEnd::ProjectPartsStorage<Sqlite::Database> projectPartsStorage{database};
RefactoringEngine engine{connectionClient.serverProxy(), refactoringClient, filePathCache, symbolQuery};
- QtCreatorSearch qtCreatorSearch;
- QtCreatorClangQueryFindFilter qtCreatorfindFilter{connectionClient.serverProxy(),
- qtCreatorSearch,
- refactoringClient};
QtCreatorRefactoringProjectUpdater projectUpdate{connectionClient.serverProxy(),
ClangPchManagerPlugin::pchManagerClient(),
filePathCache,
@@ -126,7 +122,6 @@ bool ClangRefactoringPlugin::initialize(const QStringList & /*arguments*/, QStri
d->refactoringClient.setRefactoringEngine(&d->engine);
d->refactoringClient.setRefactoringConnectionClient(&d->connectionClient);
- ExtensionSystem::PluginManager::addObject(&d->qtCreatorfindFilter);
connectBackend();
startBackend();
@@ -145,7 +140,6 @@ void ClangRefactoringPlugin::extensionsInitialized()
ExtensionSystem::IPlugin::ShutdownFlag ClangRefactoringPlugin::aboutToShutdown()
{
- ExtensionSystem::PluginManager::removeObject(&d->qtCreatorfindFilter);
CppTools::CppModelManager::removeRefactoringEngine(
CppTools::RefactoringEngineType::ClangRefactoring);
d->refactoringClient.setRefactoringConnectionClient(nullptr);
diff --git a/src/plugins/clangrefactoring/refactoringclient.cpp b/src/plugins/clangrefactoring/refactoringclient.cpp
index 3bdeb9dd53..e39e27a22a 100644
--- a/src/plugins/clangrefactoring/refactoringclient.cpp
+++ b/src/plugins/clangrefactoring/refactoringclient.cpp
@@ -40,16 +40,6 @@ void RefactoringClient::alive()
m_connectionClient->resetProcessAliveTimer();
}
-void RefactoringClient::sourceLocationsForRenamingMessage(
- ClangBackEnd::SourceLocationsForRenamingMessage &&message)
-{
- m_localRenamingCallback(message.symbolName.toQString(),
- message.sourceLocations,
- message.textDocumentRevision);
-
- m_refactoringEngine->setRefactoringEngineAvailable(true);
-}
-
void RefactoringClient::sourceRangesAndDiagnosticsForQueryMessage(
ClangBackEnd::SourceRangesAndDiagnosticsForQueryMessage &&message)
{
@@ -64,12 +54,6 @@ void RefactoringClient::sourceRangesForQueryMessage(ClangBackEnd::SourceRangesFo
setResultCounterAndSendSearchIsFinishedIfFinished();
}
-void RefactoringClient::setLocalRenamingCallback(
- CppTools::RefactoringEngineInterface::RenameCallback &&localRenamingCallback)
-{
- m_localRenamingCallback = std::move(localRenamingCallback);
-}
-
void RefactoringClient::progress(ClangBackEnd::ProgressMessage &&message)
{
m_progressManager.setProgress(message.progress, message.total);
@@ -100,11 +84,6 @@ void RefactoringClient::setClangQueryHighlighter(ClangQueryHighlighter *highligh
m_clangQueryHighlighter = highlighter;
}
-bool RefactoringClient::hasValidLocalRenamingCallback() const
-{
- return bool(m_localRenamingCallback);
-}
-
void RefactoringClient::setExpectedResultCount(uint count)
{
m_expectedResultCount = count;
diff --git a/src/plugins/clangrefactoring/refactoringclient.h b/src/plugins/clangrefactoring/refactoringclient.h
index f3d9e218e5..a68fe39211 100644
--- a/src/plugins/clangrefactoring/refactoringclient.h
+++ b/src/plugins/clangrefactoring/refactoringclient.h
@@ -54,15 +54,11 @@ public:
{}
void alive() override;
- void sourceLocationsForRenamingMessage(
- ClangBackEnd::SourceLocationsForRenamingMessage &&message) override;
void sourceRangesAndDiagnosticsForQueryMessage(
ClangBackEnd::SourceRangesAndDiagnosticsForQueryMessage &&message) override;
void sourceRangesForQueryMessage(
ClangBackEnd::SourceRangesForQueryMessage &&message) override;
- void setLocalRenamingCallback(
- CppTools::RefactoringEngineInterface::RenameCallback &&localRenamingCallback) override;
void progress(ClangBackEnd::ProgressMessage &&message) override;
void setRefactoringEngine(ClangRefactoring::RefactoringEngine *refactoringEngine);
@@ -71,8 +67,6 @@ public:
void setClangQueryExampleHighlighter(ClangQueryExampleHighlighter *highlighter);
void setClangQueryHighlighter(ClangQueryHighlighter *highlighter);
- bool hasValidLocalRenamingCallback() const;
-
void setExpectedResultCount(uint count);
uint expectedResultCount() const;
uint resultCounter() const;
@@ -90,7 +84,6 @@ private:
void sendSearchIsFinished();
private:
- CppTools::RefactoringEngineInterface::RenameCallback m_localRenamingCallback;
ClangBackEnd::RefactoringConnectionClient *m_connectionClient = nullptr;
SearchHandle *m_searchHandle = nullptr;
RefactoringEngine *m_refactoringEngine = nullptr;
diff --git a/src/plugins/clangrefactoring/refactoringengine.cpp b/src/plugins/clangrefactoring/refactoringengine.cpp
index 38f857ef1c..cc9121331d 100644
--- a/src/plugins/clangrefactoring/refactoringengine.cpp
+++ b/src/plugins/clangrefactoring/refactoringengine.cpp
@@ -28,7 +28,6 @@
#include <filepath.h>
#include <refactoringserverinterface.h>
-#include <requestsourcelocationforrenamingmessage.h>
#include <cpptools/compileroptionsbuilder.h>
#include <cpptools/cpptoolsreuse.h>
@@ -47,7 +46,6 @@
namespace ClangRefactoring {
-using ClangBackEnd::RequestSourceLocationsForRenamingMessage;
RefactoringEngine::RefactoringEngine(ClangBackEnd::RefactoringServerInterface &server,
ClangBackEnd::RefactoringClientInterface &client,
@@ -62,34 +60,10 @@ RefactoringEngine::RefactoringEngine(ClangBackEnd::RefactoringServerInterface &s
RefactoringEngine::~RefactoringEngine() = default;
-void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
- CppTools::ProjectPart *projectPart,
- RenameCallback &&renameSymbolsCallback)
+void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &,
+ CppTools::ProjectPart *,
+ RenameCallback &&)
{
- using CppTools::CompilerOptionsBuilder;
-
- setRefactoringEngineAvailable(false);
-
- m_client.setLocalRenamingCallback(std::move(renameSymbolsCallback));
-
- QString filePath = data.filePath().toString();
- QTextCursor textCursor = data.cursor();
- CompilerOptionsBuilder optionsBuilder{*projectPart, CppTools::UseSystemHeader::Yes};
- Utils::SmallStringVector commandLine{optionsBuilder.build(
- fileKindInProjectPart(projectPart, filePath),
- CppTools::getPchUsage())};
-
- commandLine.push_back(filePath);
-
- RequestSourceLocationsForRenamingMessage message(ClangBackEnd::FilePath(filePath),
- uint(textCursor.blockNumber() + 1),
- uint(textCursor.positionInBlock() + 1),
- textCursor.document()->toPlainText(),
- std::move(commandLine),
- textCursor.document()->revision());
-
-
- m_server.requestSourceLocationsForRenamingMessage(std::move(message));
}
CppTools::Usages RefactoringEngine::locationsAt(const CppTools::CursorInEditor &data) const