Commit c5941f9f authored by Marco Bubke's avatar Marco Bubke

Clang: Call updateTranslationUnit for reloaded files

If a file is reloaded it should update every translation unit.

Change-Id: Ib61d933e95fcd9fe4d32363ddc06f5edcca55e35
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 26c0d6ab
......@@ -466,7 +466,12 @@ void IpcCommunicator::updateTranslationUnitIfNotCurrentDocument(Core::IDocument
{
QTC_ASSERT(document, return);
if (Core::EditorManager::currentDocument() != document)
updateTranslationUnitFromCppEditorDocument(document->filePath().toString());
updateTranslationUnit(document);
}
void IpcCommunicator::updateTranslationUnit(Core::IDocument *document)
{
updateTranslationUnitFromCppEditorDocument(document->filePath().toString());
}
void IpcCommunicator::updateUnsavedFile(Core::IDocument *document)
......
......@@ -131,6 +131,7 @@ public:
void registerProjectsParts(const QList<CppTools::ProjectPart::Ptr> projectParts);
void updateTranslationUnitIfNotCurrentDocument(Core::IDocument *document);
void updateTranslationUnit(Core::IDocument *document);
void updateUnsavedFile(Core::IDocument *document);
void updateTranslationUnitFromCppEditorDocument(const QString &filePath);
void updateUnsavedFileFromCppEditorDocument(const QString &filePath);
......
......@@ -172,7 +172,7 @@ void ModelManagerSupportClang::onCppDocumentReloadFinishedOnTranslationUnit(bool
{
if (success) {
Core::IDocument *document = qobject_cast<Core::IDocument *>(sender());
m_ipcCommunicator.updateTranslationUnitIfNotCurrentDocument(document);
m_ipcCommunicator.updateTranslationUnit(document);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment