Clang: Rename CodeModelBackEnd in ClangBackEnd

Change-Id: I13e8a458634110456375956d4d4da7239c86957f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-06-16 11:56:00 +02:00
parent 1e92b84633
commit 1402c067b1
167 changed files with 745 additions and 954 deletions

View File

@@ -28,7 +28,7 @@
**
****************************************************************************/
#include "codemodelbackendipcintegration.h"
#include "clangbackendipcintegration.h"
#include "clangcompletion.h"
#include "clangmodelmanagersupport.h"
@@ -49,16 +49,16 @@
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <codemodelbackendipc/cmbcodecompletedcommand.h>
#include <codemodelbackendipc/cmbcompletecodecommand.h>
#include <codemodelbackendipc/cmbechocommand.h>
#include <codemodelbackendipc/cmbregistertranslationunitsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbregisterprojectsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbunregistertranslationunitsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbunregisterprojectsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbcommands.h>
#include <codemodelbackendipc/projectpartsdonotexistcommand.h>
#include <codemodelbackendipc/translationunitdoesnotexistcommand.h>
#include <clangbackendipc/cmbcodecompletedcommand.h>
#include <clangbackendipc/cmbcompletecodecommand.h>
#include <clangbackendipc/cmbechocommand.h>
#include <clangbackendipc/cmbregistertranslationunitsforcodecompletioncommand.h>
#include <clangbackendipc/cmbregisterprojectsforcodecompletioncommand.h>
#include <clangbackendipc/cmbunregistertranslationunitsforcodecompletioncommand.h>
#include <clangbackendipc/cmbunregisterprojectsforcodecompletioncommand.h>
#include <clangbackendipc/cmbcommands.h>
#include <clangbackendipc/projectpartsdonotexistcommand.h>
#include <clangbackendipc/translationunitdoesnotexistcommand.h>
#include <cplusplus/Icons.h>
@@ -71,7 +71,7 @@ static Q_LOGGING_CATEGORY(log, "qtc.clangcodemodel.ipc")
using namespace CPlusPlus;
using namespace ClangCodeModel;
using namespace ClangCodeModel::Internal;
using namespace CodeModelBackEnd;
using namespace ClangBackEnd;
using namespace TextEditor;
namespace {
@@ -79,7 +79,7 @@ namespace {
QString backendProcessPath()
{
return Core::ICore::libexecPath()
+ QStringLiteral("/codemodelbackend")
+ QStringLiteral("/clangbackend")
+ QStringLiteral(QTC_HOST_EXE_SUFFIX);
}
@@ -164,19 +164,19 @@ void IpcReceiver::projectPartsDoNotExist(const ProjectPartsDoNotExistCommand &co
class IpcSender : public IpcSenderInterface
{
public:
IpcSender(CodeModelBackEnd::ConnectionClient &connectionClient)
IpcSender(ClangBackEnd::ConnectionClient &connectionClient)
: m_connection(connectionClient)
{}
void end() override;
void registerTranslationUnitsForCodeCompletion(const CodeModelBackEnd::RegisterTranslationUnitForCodeCompletionCommand &command) override;
void unregisterTranslationUnitsForCodeCompletion(const CodeModelBackEnd::UnregisterTranslationUnitsForCodeCompletionCommand &command) override;
void registerProjectPartsForCodeCompletion(const CodeModelBackEnd::RegisterProjectPartsForCodeCompletionCommand &command) override;
void unregisterProjectPartsForCodeCompletion(const CodeModelBackEnd::UnregisterProjectPartsForCodeCompletionCommand &command) override;
void completeCode(const CodeModelBackEnd::CompleteCodeCommand &command) override;
void registerTranslationUnitsForCodeCompletion(const ClangBackEnd::RegisterTranslationUnitForCodeCompletionCommand &command) override;
void unregisterTranslationUnitsForCodeCompletion(const ClangBackEnd::UnregisterTranslationUnitsForCodeCompletionCommand &command) override;
void registerProjectPartsForCodeCompletion(const ClangBackEnd::RegisterProjectPartsForCodeCompletionCommand &command) override;
void unregisterProjectPartsForCodeCompletion(const ClangBackEnd::UnregisterProjectPartsForCodeCompletionCommand &command) override;
void completeCode(const ClangBackEnd::CompleteCodeCommand &command) override;
private:
CodeModelBackEnd::ConnectionClient &m_connection;
ClangBackEnd::ConnectionClient &m_connection;
};
void IpcSender::end()
@@ -243,12 +243,12 @@ void IpcCommunicator::initializeBackend()
}
QElapsedTimer timer; timer.start();
const QString codeModelBackEndProcessPath = backendProcessPath();
qCDebug(log) << "Starting" << codeModelBackEndProcessPath;
QTC_ASSERT(QFileInfo(codeModelBackEndProcessPath).exists(), return);
const QString clangBackEndProcessPath = backendProcessPath();
qCDebug(log) << "Starting" << clangBackEndProcessPath;
QTC_ASSERT(QFileInfo(clangBackEndProcessPath).exists(), return);
m_connection.setProcessAliveTimerInterval(10 * 1000);
m_connection.setProcessPath(codeModelBackEndProcessPath);
m_connection.setProcessPath(clangBackEndProcessPath);
connect(&m_connection, &ConnectionClient::processRestarted,
this, &IpcCommunicator::onBackendRestarted);
@@ -264,7 +264,7 @@ void IpcCommunicator::initializeBackend()
void IpcCommunicator::registerEmptyProjectForProjectLessFiles()
{
QTC_CHECK(m_connection.isConnected());
registerProjectPartsForCodeCompletion({CodeModelBackEnd::ProjectPartContainer(
registerProjectPartsForCodeCompletion({ClangBackEnd::ProjectPartContainer(
Utf8String(),
Utf8StringVector())});
}
@@ -308,18 +308,18 @@ static QStringList projectPartCommandLine(const CppTools::ProjectPart::Ptr &proj
return options;
}
static CodeModelBackEnd::ProjectPartContainer toProjectPartContainer(
static ClangBackEnd::ProjectPartContainer toProjectPartContainer(
const CppTools::ProjectPart::Ptr &projectPart)
{
const QStringList arguments = projectPartCommandLine(projectPart);
return CodeModelBackEnd::ProjectPartContainer(projectPart->projectFile,
return ClangBackEnd::ProjectPartContainer(projectPart->projectFile,
Utf8StringVector(arguments));
}
static QVector<CodeModelBackEnd::ProjectPartContainer> toProjectPartContainers(
static QVector<ClangBackEnd::ProjectPartContainer> toProjectPartContainers(
const QList<CppTools::ProjectPart::Ptr> projectParts)
{
QVector<CodeModelBackEnd::ProjectPartContainer> projectPartContainers;
QVector<ClangBackEnd::ProjectPartContainer> projectPartContainers;
projectPartContainers.reserve(projectParts.size());
foreach (const CppTools::ProjectPart::Ptr &projectPart, projectParts)
projectPartContainers << toProjectPartContainer(projectPart);
@@ -346,7 +346,7 @@ void IpcCommunicator::updateUnsavedFile(const QString &filePath, const QByteArra
// TODO: Send new only if changed
registerFilesForCodeCompletion({
CodeModelBackEnd::FileContainer(filePath,
ClangBackEnd::FileContainer(filePath,
projectFilePath,
Utf8String::fromByteArray(contents),
hasUnsavedContent)
@@ -363,7 +363,7 @@ void IpcCommunicator::updateUnsavedFileIfNotCurrentDocument(Core::IDocument *doc
void IpcCommunicator::onBackendRestarted()
{
qWarning("Codemodelbackend finished unexpectedly, restarted.");
qWarning("Clang back end finished unexpectedly, restarted.");
qCDebug(log) << "Backend restarted, re-initializing with project data and unsaved files.";
m_ipcReceiver.deleteAndClearWaitingAssistProcessors();

View File

@@ -28,15 +28,15 @@
**
****************************************************************************/
#ifndef CLANGCODEMODEL_INTERNAL_CODEMODELBACKENDIPCINTEGRATION_H
#define CLANGCODEMODEL_INTERNAL_CODEMODELBACKENDIPCINTEGRATION_H
#ifndef CLANGCODEMODEL_INTERNAL_CLANGBACKENDIPCINTEGRATION_H
#define CLANGCODEMODEL_INTERNAL_CLANGBACKENDIPCINTEGRATION_H
#include <cpptools/cppprojects.h>
#include <codemodelbackendipc/connectionclient.h>
#include <codemodelbackendipc/filecontainer.h>
#include <codemodelbackendipc/ipcclientinterface.h>
#include <codemodelbackendipc/projectpartcontainer.h>
#include <clangbackendipc/connectionclient.h>
#include <clangbackendipc/filecontainer.h>
#include <clangbackendipc/ipcclientinterface.h>
#include <clangbackendipc/projectpartcontainer.h>
#include <QObject>
#include <QSharedPointer>
@@ -58,7 +58,7 @@ class ModelManagerSupportClang;
class ClangCompletionAssistProcessor;
class IpcReceiver : public CodeModelBackEnd::IpcClientInterface
class IpcReceiver : public ClangBackEnd::IpcClientInterface
{
public:
IpcReceiver();
@@ -73,11 +73,11 @@ public:
private:
void alive() override;
void echo(const CodeModelBackEnd::EchoCommand &command) override;
void codeCompleted(const CodeModelBackEnd::CodeCompletedCommand &command) override;
void echo(const ClangBackEnd::EchoCommand &command) override;
void codeCompleted(const ClangBackEnd::CodeCompletedCommand &command) override;
void translationUnitDoesNotExist(const CodeModelBackEnd::TranslationUnitDoesNotExistCommand &command) override;
void projectPartsDoNotExist(const CodeModelBackEnd::ProjectPartsDoNotExistCommand &command) override;
void translationUnitDoesNotExist(const ClangBackEnd::TranslationUnitDoesNotExistCommand &command) override;
void projectPartsDoNotExist(const ClangBackEnd::ProjectPartsDoNotExistCommand &command) override;
private:
AliveHandler m_aliveHandler;
@@ -90,11 +90,11 @@ public:
virtual ~IpcSenderInterface() {}
virtual void end() = 0;
virtual void registerTranslationUnitsForCodeCompletion(const CodeModelBackEnd::RegisterTranslationUnitForCodeCompletionCommand &command) = 0;
virtual void unregisterTranslationUnitsForCodeCompletion(const CodeModelBackEnd::UnregisterTranslationUnitsForCodeCompletionCommand &command) = 0;
virtual void registerProjectPartsForCodeCompletion(const CodeModelBackEnd::RegisterProjectPartsForCodeCompletionCommand &command) = 0;
virtual void unregisterProjectPartsForCodeCompletion(const CodeModelBackEnd::UnregisterProjectPartsForCodeCompletionCommand &command) = 0;
virtual void completeCode(const CodeModelBackEnd::CompleteCodeCommand &command) = 0;
virtual void registerTranslationUnitsForCodeCompletion(const ClangBackEnd::RegisterTranslationUnitForCodeCompletionCommand &command) = 0;
virtual void unregisterTranslationUnitsForCodeCompletion(const ClangBackEnd::UnregisterTranslationUnitsForCodeCompletionCommand &command) = 0;
virtual void registerProjectPartsForCodeCompletion(const ClangBackEnd::RegisterProjectPartsForCodeCompletionCommand &command) = 0;
virtual void unregisterProjectPartsForCodeCompletion(const ClangBackEnd::UnregisterProjectPartsForCodeCompletionCommand &command) = 0;
virtual void completeCode(const ClangBackEnd::CompleteCodeCommand &command) = 0;
};
class IpcCommunicator : public QObject
@@ -103,8 +103,8 @@ class IpcCommunicator : public QObject
public:
using Ptr = QSharedPointer<IpcCommunicator>;
using FileContainers = QVector<CodeModelBackEnd::FileContainer>;
using ProjectPartContainers = QVector<CodeModelBackEnd::ProjectPartContainer>;
using FileContainers = QVector<ClangBackEnd::FileContainer>;
using ProjectPartContainers = QVector<ClangBackEnd::ProjectPartContainer>;
public:
IpcCommunicator();
@@ -145,7 +145,7 @@ private:
void onEditorAboutToClose(Core::IEditor *editor);
IpcReceiver m_ipcReceiver;
CodeModelBackEnd::ConnectionClient m_connection;
ClangBackEnd::ConnectionClient m_connection;
QScopedPointer<IpcSenderInterface> m_ipcSender;
SendMode m_sendMode = RespectSendRequests;
@@ -154,4 +154,4 @@ private:
} // namespace Internal
} // namespace ClangCodeModel
#endif // CLANGCODEMODEL_INTERNAL_CODEMODELBACKENDIPCINTEGRATION_H
#endif // CLANGCODEMODEL_INTERNAL_CLANGBACKENDIPCINTEGRATION_H

View File

@@ -22,7 +22,7 @@ SOURCES += \
$$PWD/clangprojectsettings.cpp \
$$PWD/clangprojectsettingspropertiespage.cpp \
$$PWD/clangutils.cpp \
$$PWD/codemodelbackendipcintegration.cpp \
$$PWD/clangbackendipcintegration.cpp \
$$PWD/completionchunkstotextconverter.cpp \
$$PWD/completionproposalsbuilder.cpp \
$$PWD/cppcreatemarkers.cpp \
@@ -53,7 +53,7 @@ HEADERS += \
$$PWD/clangprojectsettings.h \
$$PWD/clangprojectsettingspropertiespage.h \
$$PWD/clangutils.h \
$$PWD/codemodelbackendipcintegration.h \
$$PWD/clangbackendipcintegration.h \
$$PWD/completionchunkstotextconverter.h \
$$PWD/completionproposalsbuilder.h \
$$PWD/constants.h \

View File

@@ -12,7 +12,7 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "TextEditor" }
Depends { name: "Utils" }
Depends { name: "CodeModelBackEndIpc" }
Depends { name: "ClangBackEndIpc" }
pluginTestDepends: [
"CppEditor",
@@ -152,8 +152,8 @@ QtcPlugin {
"clangprojectsettingspropertiespage.ui",
"clangutils.cpp",
"clangutils.h",
"codemodelbackendipcintegration.cpp",
"codemodelbackendipcintegration.h",
"clangbackendipcintegration.cpp",
"clangbackendipcintegration.h",
"completionchunkstotextconverter.cpp",
"completionchunkstotextconverter.h",
"constants.h",

View File

@@ -1,7 +1,7 @@
QTC_PLUGIN_NAME = ClangCodeModel
QTC_LIB_DEPENDS += \
utils \
codemodelbackendipc
clangbackendipc
QTC_PLUGIN_DEPENDS += \
coreplugin \
cpptools \

View File

@@ -68,7 +68,7 @@
#include <QTextCursor>
#include <QTextDocument>
using namespace CodeModelBackEnd;
using namespace ClangBackEnd;
using namespace ClangCodeModel;
using namespace ClangCodeModel::Internal;
using namespace CPlusPlus;

View File

@@ -32,7 +32,7 @@
#define CPPEDITOR_INTERNAL_CLANGCOMPLETION_H
#include "clangcompleter.h"
#include "codemodelbackendipcintegration.h"
#include "clangbackendipcintegration.h"
#include <cpptools/cppcompletionassistprocessor.h>
#include <cpptools/cppcompletionassistprovider.h>
@@ -43,7 +43,7 @@
#include <texteditor/codeassist/completionassistprovider.h>
#include <texteditor/codeassist/ifunctionhintproposalmodel.h>
#include <codemodelbackendipc/codecompletion.h>
#include <clangbackendipc/codecompletion.h>
#include <QStringList>
#include <QTextCursor>
@@ -51,7 +51,7 @@
namespace ClangCodeModel {
namespace Internal {
using CodeCompletions = QVector<CodeModelBackEnd::CodeCompletion>;
using CodeCompletions = QVector<ClangBackEnd::CodeCompletion>;
class ClangAssistProposalModel;
@@ -87,16 +87,16 @@ public:
void keepCompletionOperator(unsigned compOp) { m_completionOperator = compOp; }
bool isOverloaded() const;
void addOverload(const CodeModelBackEnd::CodeCompletion &ccr);
void addOverload(const ClangBackEnd::CodeCompletion &ccr);
CodeModelBackEnd::CodeCompletion originalItem() const;
ClangBackEnd::CodeCompletion originalItem() const;
bool isCodeCompletion() const;
private:
unsigned m_completionOperator;
mutable QChar m_typedChar;
QList<CodeModelBackEnd::CodeCompletion> m_overloads;
QList<ClangBackEnd::CodeCompletion> m_overloads;
};
class ClangFunctionHintModel : public TextEditor::IFunctionHintProposalModel

View File

@@ -138,7 +138,7 @@ ClangEditorDocumentProcessor::~ClangEditorDocumentProcessor()
QTC_ASSERT(m_modelManagerSupport, return);
m_modelManagerSupport->ipcCommunicator()->unregisterFilesForCodeCompletion(
{CodeModelBackEnd::FileContainer(filePath(), projectFilePath)});
{ClangBackEnd::FileContainer(filePath(), projectFilePath)});
}
void ClangEditorDocumentProcessor::run()

View File

@@ -40,9 +40,9 @@
#include <cpptools/editordocumenthandle.h>
#include <projectexplorer/project.h>
#include <codemodelbackendipc/cmbregisterprojectsforcodecompletioncommand.h>
#include <codemodelbackendipc/filecontainer.h>
#include <codemodelbackendipc/projectpartcontainer.h>
#include <clangbackendipc/cmbregisterprojectsforcodecompletioncommand.h>
#include <clangbackendipc/filecontainer.h>
#include <clangbackendipc/projectpartcontainer.h>
#include <utils/qtcassert.h>
#include <QCoreApplication>
@@ -160,7 +160,7 @@ void ModelManagerSupportClang::onAbstractEditorSupportRemoved(const QString &fil
if (!cppModelManager()->cppEditorDocument(filePath)) {
const QString projectFilePath = Utils::projectFilePathForFile(filePath);
m_ipcCommunicator->unregisterFilesForCodeCompletion(
{CodeModelBackEnd::FileContainer(filePath, projectFilePath)});
{ClangBackEnd::FileContainer(filePath, projectFilePath)});
}
}

View File

@@ -33,7 +33,7 @@
namespace ClangCodeModel {
namespace Internal {
void CompletionChunksToTextConverter::parseChunks(const QVector<CodeModelBackEnd::CodeCompletionChunk> &codeCompletionChunks)
void CompletionChunksToTextConverter::parseChunks(const QVector<ClangBackEnd::CodeCompletionChunk> &codeCompletionChunks)
{
m_text.clear();
@@ -46,7 +46,7 @@ const QString &CompletionChunksToTextConverter::text() const
return m_text;
}
QString CompletionChunksToTextConverter::convert(const QVector<CodeModelBackEnd::CodeCompletionChunk> &codeCompletionChunks)
QString CompletionChunksToTextConverter::convert(const QVector<ClangBackEnd::CodeCompletionChunk> &codeCompletionChunks)
{
CompletionChunksToTextConverter converter;
@@ -55,9 +55,9 @@ QString CompletionChunksToTextConverter::convert(const QVector<CodeModelBackEnd:
return converter.text();
}
void CompletionChunksToTextConverter::parse(const CodeModelBackEnd::CodeCompletionChunk &codeCompletionChunk)
void CompletionChunksToTextConverter::parse(const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk)
{
using CodeModelBackEnd::CodeCompletionChunk;
using ClangBackEnd::CodeCompletionChunk;
switch (codeCompletionChunk.kind()) {
case CodeCompletionChunk::ResultType: parseResultType(codeCompletionChunk.text()); break;
@@ -76,7 +76,7 @@ void CompletionChunksToTextConverter::parseText(const Utf8String &text)
m_text += text.toString();
}
void CompletionChunksToTextConverter::parseOptional(const CodeModelBackEnd::CodeCompletionChunk &optionalCodeCompletionChunk)
void CompletionChunksToTextConverter::parseOptional(const ClangBackEnd::CodeCompletionChunk &optionalCodeCompletionChunk)
{
m_text += QStringLiteral("<i>");

View File

@@ -31,7 +31,7 @@
#ifndef CLANGCODEMODEL_INTERNAL_COMPLETIONCHUNKSTOTEXTCONVERTER_H
#define CLANGCODEMODEL_INTERNAL_COMPLETIONCHUNKSTOTEXTCONVERTER_H
#include <codemodelbackendipc/codecompletionchunk.h>
#include <clangbackendipc/codecompletionchunk.h>
#include <QString>
@@ -43,17 +43,17 @@ namespace Internal {
class CompletionChunksToTextConverter
{
public:
void parseChunks(const QVector<CodeModelBackEnd::CodeCompletionChunk> &codeCompletionChunks);
void parseChunks(const QVector<ClangBackEnd::CodeCompletionChunk> &codeCompletionChunks);
const QString &text() const;
static QString convert(const QVector<CodeModelBackEnd::CodeCompletionChunk> &codeCompletionChunks);
static QString convert(const QVector<ClangBackEnd::CodeCompletionChunk> &codeCompletionChunks);
private:
void parse(const CodeModelBackEnd::CodeCompletionChunk & codeCompletionChunk);
void parse(const ClangBackEnd::CodeCompletionChunk & codeCompletionChunk);
void parseResultType(const Utf8String &text);
void parseText(const Utf8String &text);
void parseOptional(const CodeModelBackEnd::CodeCompletionChunk & optionalCodeCompletionChunk);
void parseOptional(const ClangBackEnd::CodeCompletionChunk & optionalCodeCompletionChunk);
private:
QString m_text;

View File

@@ -30,7 +30,7 @@
#include "clangcodecompletion_test.h"
#include "../codemodelbackendipcintegration.h"
#include "../clangbackendipcintegration.h"
#include "../clangmodelmanagersupport.h"
#include <clangcodemodel/clangcompletion.h>
@@ -52,19 +52,19 @@
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <codemodelbackendipc/cmbcompletecodecommand.h>
#include <codemodelbackendipc/cmbendcommand.h>
#include <codemodelbackendipc/cmbregisterprojectsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbregistertranslationunitsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbunregisterprojectsforcodecompletioncommand.h>
#include <codemodelbackendipc/cmbunregistertranslationunitsforcodecompletioncommand.h>
#include <clangbackendipc/cmbcompletecodecommand.h>
#include <clangbackendipc/cmbendcommand.h>
#include <clangbackendipc/cmbregisterprojectsforcodecompletioncommand.h>
#include <clangbackendipc/cmbregistertranslationunitsforcodecompletioncommand.h>
#include <clangbackendipc/cmbunregisterprojectsforcodecompletioncommand.h>
#include <clangbackendipc/cmbunregistertranslationunitsforcodecompletioncommand.h>
#include <utils/changeset.h>
#include <utils/qtcassert.h>
#include <QDebug>
#include <QtTest>
using namespace CodeModelBackEnd;
using namespace ClangBackEnd;
using namespace ClangCodeModel;
using namespace ClangCodeModel::Internal;