diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index ccef13222dc..326539e5619 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -1061,11 +1061,11 @@ void ClangdClient::findUsages(TextDocument *document, const QTextCursor &cursor, const Utils::optional &replacement) { // Quick check: Are we even on anything searchable? - const QString searchTerm = d->searchTermFromCursor(cursor); + const QTextCursor adjustedCursor = d->adjustedCursor(cursor, document); + const QString searchTerm = d->searchTermFromCursor(adjustedCursor); if (searchTerm.isEmpty()) return; - const QTextCursor adjustedCursor = d->adjustedCursor(cursor, document); const bool categorize = CppEditor::codeModelSettings()->categorizeFindReferences(); // If it's a "normal" symbol, go right ahead.