ClangCodeModel: Make use of clangd's non-const ref parameter tagging

clangd 14 will tag non-const reference parameters for us (https://
reviews.llvm.org/D108320), so let's make use of that at least as a
shortcut.

Change-Id: I0162b5d7b9fecc3e6ce0338e896980cd5b363ceb
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-15 12:39:04 +02:00
parent bcfe229f8b
commit ad23d86b41

View File

@@ -2427,6 +2427,8 @@ static void semanticHighlighter(QFutureInterface<TextEditor::HighlightingResult>
QTextDocument doc(docContents); QTextDocument doc(docContents);
const auto isOutputParameter = [&ast](const ExpandedSemanticToken &token) { const auto isOutputParameter = [&ast](const ExpandedSemanticToken &token) {
if (token.modifiers.contains("usedAsMutableReference"))
return true;
if (token.type != "variable" && token.type != "property" && token.type != "parameter") if (token.type != "variable" && token.type != "property" && token.type != "parameter")
return false; return false;
const Position pos(token.line - 1, token.column - 1); const Position pos(token.line - 1, token.column - 1);