ClangCodeModel: Rename via LSP facilities

Contrary to our original expectation, clangd's textDocument/rename does
not necessarily yield the same locations as /references. Instead, it can
find fewer or more occurrences, depending on server-side logic about what
constitutes a reference vs what should be renamed. Therefore, we need to
use /rename for proper behavior.

Fixes: QTCREATORBUG-27978
Fixes: QTCREATORBUG-28109
Change-Id: I27d092e807a4aa59dc0674111429c77ca13010e9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-09-20 16:41:44 +02:00
parent 96d60713bf
commit 7dc2c6b3b3
3 changed files with 19 additions and 99 deletions

View File

@@ -25,7 +25,7 @@ class ClangdFindReferences : public QObject
public:
explicit ClangdFindReferences(ClangdClient *client, TextEditor::TextDocument *document,
const QTextCursor &cursor, const QString &searchTerm,
const std::optional<QString> &replacement, bool categorize);
bool categorize);
~ClangdFindReferences();
signals: