Clang: Add UpdateTranslationUnitsForEditorMessage

If an editor is changing all translation units independent of their project
part they must be updated too. So we introduce a new message to update all
translation units with the same file path.

Change-Id: I70d0ea2bbca9fa880111ff7219573e54f3277026
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-10-13 15:56:41 +02:00
parent b1dced66d7
commit 250c8d662b
37 changed files with 673 additions and 106 deletions

View File

@@ -61,6 +61,7 @@
#include <clangbackendipc/cmbunregisterprojectsforeditormessage.h>
#include <clangbackendipc/cmbunregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/registerunsavedfilesforeditormessage.h>
#include <clangbackendipc/updatetranslationunitsforeditormessage.h>
#include <utils/changeset.h>
#include <utils/qtcassert.h>
@@ -319,8 +320,16 @@ QString toString(const RegisterTranslationUnitForEditorMessage &message)
ts << "RegisterTranslationUnitForEditorMessage\n"
<< toString(message.fileContainers());
return out;
}
return QLatin1String("RegisterTranslationUnitForEditorMessage\n");
QString toString(const UpdateTranslationUnitsForEditorMessage &message)
{
QString out;
QTextStream ts(&out);
ts << "UpdateTranslationUnitForEditorMessage\n"
<< toString(message.fileContainers());
return out;
}
QString toString(const UnregisterTranslationUnitsForEditorMessage &)
@@ -356,8 +365,6 @@ QString toString(const RegisterUnsavedFilesForEditorMessage &message)
ts << "RegisterUnsavedFilesForEditorMessage\n"
<< toString(message.fileContainers());
return out;
return QLatin1String("RegisterUnsavedFilesForEditorMessage\n");
}
QString toString(const UnregisterUnsavedFilesForEditorMessage &)
@@ -384,6 +391,9 @@ public:
void registerTranslationUnitsForEditor(const RegisterTranslationUnitForEditorMessage &message) override
{ senderLog.append(toString(message)); }
void updateTranslationUnitsForEditor(const UpdateTranslationUnitsForEditorMessage &message) override
{ senderLog.append(toString(message)); }
void unregisterTranslationUnitsForEditor(const UnregisterTranslationUnitsForEditorMessage &message) override
{ senderLog.append(toString(message)); }