forked from qt-creator/qt-creator
Clang: Clean up some IPC names
This is long overdue since some names were simply wrong and/or misleading. Also, some of the old names were long enough to almost get crazy. The renaming starts from ClangCodeModelServerInterface and ClangCodeModelClientInterface and affects usages and related functions. For the ClangCodeModelServerInterface, categorize the messages in - messages that require a response (request*) - notification messages (the remaining ones) Change-Id: I5342ed8e0d87404ee72f3c3766fd8ef7505defb1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -49,9 +49,9 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <clangsupport/cmbregisterprojectsforeditormessage.h>
|
||||
#include <clangsupport/filecontainer.h>
|
||||
#include <clangsupport/projectpartcontainer.h>
|
||||
#include <clangsupport/projectpartsupdatedmessage.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -108,7 +108,7 @@ ModelManagerSupportClang::ModelManagerSupportClang()
|
||||
connect(settings, &CppTools::CppCodeModelSettings::clangDiagnosticConfigsInvalidated,
|
||||
this, &ModelManagerSupportClang::onDiagnosticConfigsInvalidated);
|
||||
|
||||
m_communicator.registerFallbackProjectPart();
|
||||
m_communicator.projectPartsUpdatedForFallback();
|
||||
}
|
||||
|
||||
ModelManagerSupportClang::~ModelManagerSupportClang()
|
||||
@@ -150,7 +150,7 @@ CppTools::BaseEditorDocumentProcessor *ModelManagerSupportClang::createEditorDoc
|
||||
|
||||
void ModelManagerSupportClang::onCurrentEditorChanged(Core::IEditor *editor)
|
||||
{
|
||||
m_communicator.updateTranslationUnitVisiblity();
|
||||
m_communicator.documentVisibilityChanged();
|
||||
|
||||
// Update task hub issues for current CppEditorDocument
|
||||
ClangEditorDocumentProcessor::clearTaskHubIssues();
|
||||
@@ -232,7 +232,7 @@ void ModelManagerSupportClang::onEditorOpened(Core::IEditor *editor)
|
||||
|
||||
void ModelManagerSupportClang::onEditorClosed(const QList<Core::IEditor *> &)
|
||||
{
|
||||
m_communicator.updateTranslationUnitVisiblity();
|
||||
m_communicator.documentVisibilityChanged();
|
||||
}
|
||||
|
||||
void ModelManagerSupportClang::onCppDocumentAboutToReloadOnTranslationUnit()
|
||||
@@ -247,7 +247,7 @@ void ModelManagerSupportClang::onCppDocumentReloadFinishedOnTranslationUnit(bool
|
||||
if (success) {
|
||||
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
|
||||
connectToTextDocumentContentsChangedForTranslationUnit(textDocument);
|
||||
m_communicator.updateTranslationUnitWithRevisionCheck(textDocument);
|
||||
m_communicator.documentsChangedWithRevisionCheck(textDocument);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ void ModelManagerSupportClang::onCppDocumentContentsChangedOnTranslationUnit(int
|
||||
|
||||
m_communicator.updateChangeContentStartPosition(document->filePath().toString(),
|
||||
position);
|
||||
m_communicator.updateTranslationUnitIfNotCurrentDocument(document);
|
||||
m_communicator.documentsChangedIfNotCurrentDocument(document);
|
||||
|
||||
clearDiagnosticFixIts(document->filePath().toString());
|
||||
}
|
||||
@@ -285,14 +285,14 @@ void ModelManagerSupportClang::onCppDocumentReloadFinishedOnUnsavedFile(bool suc
|
||||
if (success) {
|
||||
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
|
||||
connectToTextDocumentContentsChangedForUnsavedFile(textDocument);
|
||||
m_communicator.updateUnsavedFile(textDocument);
|
||||
m_communicator.unsavedFilesUpdated(textDocument);
|
||||
}
|
||||
}
|
||||
|
||||
void ModelManagerSupportClang::onCppDocumentContentsChangedOnUnsavedFile()
|
||||
{
|
||||
Core::IDocument *document = qobject_cast<Core::IDocument *>(sender());
|
||||
m_communicator.updateUnsavedFile(document);
|
||||
m_communicator.unsavedFilesUpdated(document);
|
||||
}
|
||||
|
||||
void ModelManagerSupportClang::onAbstractEditorSupportContentsUpdated(const QString &filePath,
|
||||
@@ -301,7 +301,7 @@ void ModelManagerSupportClang::onAbstractEditorSupportContentsUpdated(const QStr
|
||||
QTC_ASSERT(!filePath.isEmpty(), return);
|
||||
|
||||
const QString mappedPath = m_uiHeaderOnDiskManager.createIfNeeded(filePath);
|
||||
m_communicator.updateUnsavedFile(mappedPath, content, 0);
|
||||
m_communicator.unsavedFilesUpdated(mappedPath, content, 0);
|
||||
}
|
||||
|
||||
void ModelManagerSupportClang::onAbstractEditorSupportRemoved(const QString &filePath)
|
||||
@@ -311,7 +311,7 @@ void ModelManagerSupportClang::onAbstractEditorSupportRemoved(const QString &fil
|
||||
if (!cppModelManager()->cppEditorDocument(filePath)) {
|
||||
const QString mappedPath = m_uiHeaderOnDiskManager.remove(filePath);
|
||||
const QString projectPartId = Utils::projectPartIdForFile(filePath);
|
||||
m_communicator.unregisterUnsavedFilesForEditor({{mappedPath, projectPartId}});
|
||||
m_communicator.unsavedFilesRemoved({{mappedPath, projectPartId}});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,16 +411,16 @@ void ModelManagerSupportClang::onProjectPartsUpdated(ProjectExplorer::Project *p
|
||||
const CppTools::ProjectInfo projectInfo = cppModelManager()->projectInfo(project);
|
||||
QTC_ASSERT(projectInfo.isValid(), return);
|
||||
|
||||
m_communicator.registerProjectsParts(projectInfo.projectParts());
|
||||
m_communicator.registerFallbackProjectPart();
|
||||
m_communicator.projectPartsUpdated(projectInfo.projectParts());
|
||||
m_communicator.projectPartsUpdatedForFallback();
|
||||
}
|
||||
|
||||
void ModelManagerSupportClang::onProjectPartsRemoved(const QStringList &projectPartIds)
|
||||
{
|
||||
if (!projectPartIds.isEmpty()) {
|
||||
unregisterTranslationUnitsWithProjectParts(projectPartIds);
|
||||
m_communicator.unregisterProjectPartsForEditor(projectPartIds);
|
||||
m_communicator.registerFallbackProjectPart();
|
||||
closeBackendDocumentsWithProjectParts(projectPartIds);
|
||||
m_communicator.projectPartsRemoved(projectPartIds);
|
||||
m_communicator.projectPartsUpdatedForFallback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,12 +445,12 @@ clangProcessorsWithProjectParts(const QStringList &projectPartIds)
|
||||
});
|
||||
}
|
||||
|
||||
void ModelManagerSupportClang::unregisterTranslationUnitsWithProjectParts(
|
||||
void ModelManagerSupportClang::closeBackendDocumentsWithProjectParts(
|
||||
const QStringList &projectPartIds)
|
||||
{
|
||||
const auto processors = clangProcessorsWithProjectParts(projectPartIds);
|
||||
foreach (ClangEditorDocumentProcessor *processor, processors) {
|
||||
processor->unregisterTranslationUnitForEditor();
|
||||
processor->closeBackendDocument();
|
||||
processor->clearProjectPart();
|
||||
processor->run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user