From d579608e8a74c2179d44192556cf0b9debe817a4 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 1 Dec 2015 11:57:08 +0100 Subject: 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 --- src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/plugins/clangcodemodel/test') 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")); -- cgit v1.2.1