ClangCodeModel: Do not try to rename macros and namespaces with clangd

Unfortunately, clangd refuses to rename macros and namespaces.
Fall back to our old two-stage "find + replace" approach for macros
(which clangd can find just fine) and employ the built-in code model for
namespaces (as they don't get indexed at all by clangd).

Change-Id: I08b1088ff4de9220427e089ef0700dbf2a944081
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Christian Kandeler
2023-04-03 14:12:39 +02:00
parent 6ad3531b15
commit 0319542937
4 changed files with 51 additions and 15 deletions

View File

@@ -294,7 +294,7 @@ void ClangdTestFindReferences::test()
QVERIFY(doc);
QTextCursor cursor(doc->document());
cursor.setPosition(pos);
client()->findUsages(doc, cursor, {}, {});
client()->findUsages(CppEditor::CursorInEditor(cursor, doc->filePath(), nullptr, doc), {}, {});
QVERIFY(waitForSignalOrTimeout(client(), &ClangdClient::findUsagesDone, timeOutInMs()));
QCOMPARE(m_actualResults.size(), expectedResults.size());