forked from qt-creator/qt-creator
Utils: Add sorted() function
For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -30,19 +30,15 @@ namespace LanguageClient {
|
||||
|
||||
const QList<SymbolInformation> sortedSymbols(const QList<SymbolInformation> &symbols)
|
||||
{
|
||||
auto result = symbols;
|
||||
Utils::sort(result, [](const SymbolInformation &a, const SymbolInformation &b){
|
||||
return Utils::sorted(symbols, [](const SymbolInformation &a, const SymbolInformation &b){
|
||||
return a.location().range().start() < b.location().range().start();
|
||||
});
|
||||
return result;
|
||||
}
|
||||
const QList<DocumentSymbol> sortedSymbols(const QList<DocumentSymbol> &symbols)
|
||||
{
|
||||
auto result = symbols;
|
||||
Utils::sort(result, [](const DocumentSymbol &a, const DocumentSymbol &b){
|
||||
return Utils::sorted(symbols, [](const DocumentSymbol &a, const DocumentSymbol &b){
|
||||
return a.range().start() < b.range().start();
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
class LanguageClientOutlineItem : public Utils::TypedTreeItem<LanguageClientOutlineItem>
|
||||
|
||||
Reference in New Issue
Block a user