ClangCodeModel: Do not traverse the AST in the semantic highlighter

... with clangd >= 17. We do not need to look at AST nodes anymore;
everything comes from the server.

Change-Id: I46eb91f26515e31b752020edbc32f1b23c1d79c7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-01-31 18:32:29 +01:00
parent 801709f72e
commit e771560ec7
2 changed files with 113 additions and 111 deletions

View File

@@ -1468,7 +1468,10 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc,
data.highlighter->setHighlightingRunner(runner);
data.highlighter->run();
};
getAndHandleAst(doc, astHandler, AstCallbackMode::SyncIfPossible);
if (q->versionNumber().majorVersion() >= 17)
astHandler({}, {});
else
getAndHandleAst(doc, astHandler, AstCallbackMode::SyncIfPossible);
}
std::optional<QList<CodeAction> > ClangdDiagnostic::codeActions() const