2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-07-07 17:04:23 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/find/searchresultitem.h>
|
2022-08-03 12:58:48 +02:00
|
|
|
#include <cppeditor/cursorineditor.h>
|
2022-10-27 14:49:15 +02:00
|
|
|
#include <utils/link.h>
|
2022-07-07 17:04:23 +02:00
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
2022-08-26 10:30:00 +02:00
|
|
|
#include <optional>
|
|
|
|
|
|
2022-07-07 17:04:23 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QTextCursor;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2022-10-27 14:49:15 +02:00
|
|
|
namespace Core { class SearchResult; }
|
2022-07-07 17:04:23 +02:00
|
|
|
namespace TextEditor { class TextDocument; }
|
|
|
|
|
|
|
|
|
|
namespace ClangCodeModel::Internal {
|
|
|
|
|
class ClangdClient;
|
|
|
|
|
|
|
|
|
|
class ClangdFindReferences : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2022-10-27 14:49:15 +02:00
|
|
|
ClangdFindReferences(ClangdClient *client, TextEditor::TextDocument *document,
|
|
|
|
|
const QTextCursor &cursor, const QString &searchTerm,
|
|
|
|
|
const std::optional<QString> &replacement, bool categorize);
|
|
|
|
|
ClangdFindReferences(ClangdClient *client, const Utils::Link &link, Core::SearchResult *search,
|
|
|
|
|
const Utils::LinkHandler &callback);
|
2022-07-07 17:04:23 +02:00
|
|
|
~ClangdFindReferences();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void foundReferences(const QList<Core::SearchResultItem> &items);
|
|
|
|
|
void done();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
class Private;
|
2022-10-27 14:49:15 +02:00
|
|
|
class CheckUnusedData;
|
2022-07-07 17:04:23 +02:00
|
|
|
Private * const d;
|
|
|
|
|
};
|
|
|
|
|
|
2022-08-03 12:58:48 +02:00
|
|
|
class ClangdFindLocalReferences : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit ClangdFindLocalReferences(ClangdClient *client, TextEditor::TextDocument *document,
|
|
|
|
|
const QTextCursor &cursor,
|
|
|
|
|
const CppEditor::RenameCallback &callback);
|
|
|
|
|
~ClangdFindLocalReferences();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void done();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
class Private;
|
|
|
|
|
Private * const d;
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-07 17:04:23 +02:00
|
|
|
} // namespace ClangCodeModel::Internal
|