diff options
author | Marco Bubke <marco.bubke@theqtcompany.com> | 2015-12-01 11:57:08 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@theqtcompany.com> | 2015-12-01 11:14:39 +0000 |
commit | d579608e8a74c2179d44192556cf0b9debe817a4 (patch) | |
tree | c531175d8cb72d3e20622a46374d6850606336ca /src/plugins/clangcodemodel/test | |
parent | db5bd69b261ed200287b0a06b3c9d979d86380f4 (diff) | |
download | qt-creator-d579608e8a74c2179d44192556cf0b9debe817a4.tar.gz |
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>
Diffstat (limited to 'src/plugins/clangcodemodel/test')
-rw-r--r-- | src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index fca3051875..41d12cce5e 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -385,6 +385,11 @@ QString toString(const RequestHighlightingMessage &) return QStringLiteral("RequestHighlightingMessage\n"); } +QString toString(const UpdateVisibleTranslationUnitsMessage &) +{ + return QStringLiteral("UpdateVisibleTranslationUnitsMessage\n"); +} + class IpcSenderSpy : public IpcSenderInterface { public: @@ -421,6 +426,9 @@ public: void requestHighlighting(const RequestHighlightingMessage &message) override { senderLog.append(toString(message)); } + void updateVisibleTranslationUnits(const UpdateVisibleTranslationUnitsMessage &message) override + { senderLog.append(toString(message)); } + public: QString senderLog; }; @@ -1074,6 +1082,7 @@ void ClangCodeCompletionTest::testCompleteAfterModifyingIncludedHeaderInOtherEdi // Switch back to source file and check if modified header is reflected in completions. Core::EditorManager::activateEditor(openSource.editor()); + QCoreApplication::processEvents(); // connections are queued proposal = completionResults(openSource.editor()); QVERIFY(hasItem(proposal, "globalFromHeader")); QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved")); |