forked from qt-creator/qt-creator
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:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user