forked from qt-creator/qt-creator
Fixes: Clang: Sort the initial list of includes for the code completion
Task-number: QTCREATORBUG-6242 Change-Id: Icdd5671801079a547a08b1276a6dbc76fed4bd30 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -445,6 +445,12 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
|
||||
completeIncludePath(realPath, suffixes);
|
||||
}
|
||||
|
||||
auto includesCompare = [](AssistProposalItemInterface *first,
|
||||
AssistProposalItemInterface *second) {
|
||||
return first->text() < second->text();
|
||||
};
|
||||
std::sort(m_completions.begin(), m_completions.end(), includesCompare);
|
||||
|
||||
return !m_completions.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user