ClangCodeModel: Adapt to new "virtual" modifier

... in clangd's semantic tokens.
See https://reviews.llvm.org/D107145.

Change-Id: Idf9fe327df3fb806697ab5b806e89bb62d43e706
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-07-30 11:55:25 +02:00
parent 8e41a401b0
commit 11da66f768
2 changed files with 20 additions and 8 deletions

View File

@@ -758,7 +758,7 @@ void ClangdTestHighlighting::test_data()
QTest::newRow("virtual function call via pointer") << 192 << 33 << 192 << 48
<< QList<int>{C_VIRTUAL_METHOD} << 0;
QTest::newRow("final virtual function call via pointer") << 202 << 38 << 202 << 58
<< QList<int>{C_FUNCTION} << 0;
<< QList<int>{C_VIRTUAL_METHOD} << 0;
QTest::newRow("non-final virtual function call via pointer") << 207 << 41 << 207 << 61
<< QList<int>{C_VIRTUAL_METHOD} << 0;
QTest::newRow("operator+ declaration") << 220 << 18 << 220 << 19
@@ -1297,12 +1297,18 @@ void ClangdTestHighlighting::test()
for (const TextEditor::TextStyle s : result.textStyles.mixinStyles)
actualStyles << s;
}
QEXPECT_FAIL("virtual member function definition outside of class body",
"FIXME: send virtual info in clangd", Continue);
QEXPECT_FAIL("virtual function call via pointer",
"FIXME: send virtual info in clangd", Continue);
QEXPECT_FAIL("non-final virtual function call via pointer",
"FIXME: send virtual info in clangd", Continue);
if (client()->versionNumber() < QVersionNumber(14)) {
QEXPECT_FAIL("final virtual function call via pointer",
"clangd < 14 does not send virtual modifier", Continue);
QEXPECT_FAIL("virtual member function definition outside of class body",
"clangd < 14 does not send virtual modifier", Continue);
QEXPECT_FAIL("virtual function call via pointer",
"clangd < 14 does not send virtual modifier", Continue);
QEXPECT_FAIL("non-final virtual function call via pointer",
"clangd < 14 does not send virtual modifier", Continue);
}
QEXPECT_FAIL("template non-type parameter",
"FIXME: clangd reports non-type template parameters at \"typeParameter\"",
Continue);