forked from qt-creator/qt-creator
ClangCodeModel: Derive displayed search term from adjusted cursor
Otherwise, we can have discrepancies between displayed and actual search term. Change-Id: Iadd2ec54db4cef4b103c3c0ef98eb47828ea544b 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:
@@ -1061,11 +1061,11 @@ void ClangdClient::findUsages(TextDocument *document, const QTextCursor &cursor,
|
||||
const Utils::optional<QString> &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.
|
||||
|
||||
Reference in New Issue
Block a user