Clang: Prioritize current and visible translation units

We reparse first the current and then the visible translation units before
we reparse all other units.

The signals connections are queued to wait for the visible editor update.

Change-Id: I5e2b8bc80568450268ca24e26720b3f5af640995
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-12-01 11:57:08 +01:00
parent db5bd69b26
commit d579608e8a
8 changed files with 121 additions and 4 deletions

View File

@@ -107,6 +107,7 @@ public:
virtual void completeCode(const ClangBackEnd::CompleteCodeMessage &message) = 0;
virtual void requestDiagnostics(const ClangBackEnd::RequestDiagnosticsMessage &message) = 0;
virtual void requestHighlighting(const ClangBackEnd::RequestHighlightingMessage &message) = 0;
virtual void updateVisibleTranslationUnits(const ClangBackEnd::UpdateVisibleTranslationUnitsMessage &message) = 0;
};
class IpcCommunicator : public QObject
@@ -149,6 +150,7 @@ public:
void updateChangeContentStartPosition(const QString &filePath, int position);
void registerFallbackProjectPart();
void updateTranslationUnitVisiblity();
public: // for tests
IpcSenderInterface *setIpcSender(IpcSenderInterface *ipcSender);
@@ -171,6 +173,9 @@ private:
void onEditorAboutToClose(Core::IEditor *editor);
void onCoreAboutToClose();
void updateTranslationUnitVisiblity(const Utf8String &currentEditorFilePath,
const Utf8StringVector &visibleEditorsFilePaths);
private:
IpcReceiver m_ipcReceiver;
ClangBackEnd::ConnectionClient m_connection;