forked from qt-creator/qt-creator
ClangCodeModel: Fix local renamings with clangd
This functionality somehow stayed in the proof-of-concept stage, working only for free functions. Fixes: QTCREATORBUG-27249 Change-Id: I840beae66314330ce643e159c596e702a0ec3273 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1989,7 +1989,10 @@ void ClangdClient::findLocalUsages(TextDocument *document, const QTextCursor &cu
|
||||
const QList<AstNode> astPath = getAstPath(ast, linkPos);
|
||||
bool isVar = false;
|
||||
for (auto it = astPath.rbegin(); it != astPath.rend(); ++it) {
|
||||
if (it->role() == "declaration" && it->kind() == "Function") {
|
||||
if (it->role() == "declaration"
|
||||
&& (it->kind() == "Function" || it->kind() == "CXXMethod"
|
||||
|| it->kind() == "CXXConstructor" || it->kind() == "CXXDestructor"
|
||||
|| it->kind() == "Lambda")) {
|
||||
if (!isVar)
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user