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:
@@ -352,14 +352,13 @@ void SemanticTokenSupport::handleSemanticTokensDelta(
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "New Data " << tokens->data();
|
||||
} else if (auto tokensDelta = std::get_if<SemanticTokensDelta>(&result)) {
|
||||
m_tokens[filePath].version = documentVersion;
|
||||
QList<SemanticTokensEdit> edits = tokensDelta->edits();
|
||||
const QList<SemanticTokensEdit> edits = Utils::sorted(tokensDelta->edits(),
|
||||
&SemanticTokensEdit::start);
|
||||
if (edits.isEmpty()) {
|
||||
highlight(filePath);
|
||||
return;
|
||||
}
|
||||
|
||||
Utils::sort(edits, &SemanticTokensEdit::start);
|
||||
|
||||
SemanticTokens &tokens = m_tokens[filePath].tokens;
|
||||
const QList<int> &data = tokens.data();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user