forked from qt-creator/qt-creator
ClangCodeModel: Support access type categorization
... with "Find Usages", as we do in the built-in code model.
Note 1: This is very slow, so it's for now only enabled if the
search results come from a small number of files.
Possible ways of speeding up the operation
to be investigated.
Note 2: All test cases from the old code model also pass here,
but checking with non-trivial real-world projects
shows a lot of mis-categorizations.
Well will fix them one by one.
Note 3: This functionality requires clangd >= 13.
Change-Id: Ib3500b52996dbbf9d7d9712d729179bcbd3262fc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -27,7 +27,11 @@
|
||||
|
||||
#include <languageclient/client.h>
|
||||
|
||||
#include <QVersionNumber>
|
||||
|
||||
namespace Core { class SearchResultItem; }
|
||||
namespace ProjectExplorer { class Project; }
|
||||
namespace TextEditor { class TextDocument; }
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
@@ -37,11 +41,26 @@ class ClangdClient : public LanguageClient::Client
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClangdClient(ProjectExplorer::Project *project, const Utils::FilePath &jsonDbDir);
|
||||
~ClangdClient() override;
|
||||
|
||||
bool isFullyIndexed() const { return m_isFullyIndexed; }
|
||||
bool isFullyIndexed() const;
|
||||
QVersionNumber versionNumber() const;
|
||||
|
||||
void openExtraFile(const Utils::FilePath &filePath, const QString &content = {});
|
||||
void closeExtraFile(const Utils::FilePath &filePath);
|
||||
|
||||
void findUsages(TextEditor::TextDocument *document, const QTextCursor &cursor);
|
||||
|
||||
void enableTesting();
|
||||
|
||||
signals:
|
||||
void indexingFinished();
|
||||
void foundReferences(const QList<Core::SearchResultItem> &items);
|
||||
void findUsagesDone();
|
||||
|
||||
private:
|
||||
bool m_isFullyIndexed = false;
|
||||
class Private;
|
||||
Private * const d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user