ClangCodeModel: Add menu action to re-index files

... that depend on changed headers.
When changing a header file the clangd code model is not updated for
files that including it if they are not opened in editor.
This is not to be done automatically, as it would be a performance
hazard to rescan many files, for example when changing a widely used
header.
Add a menu action to trigger such re-indexing manually to solve the
issue.

Task-number: QTCREATORBUG-27387
Change-Id: Ia8033401f847627cee041b102f9ac6f3af3dd709
Reviewed-by: Volodymyr Zibarov <gogan419@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Volodymyr Zibarov
2023-11-01 10:30:01 +02:00
parent f9d4697371
commit d0203a39fa
3 changed files with 122 additions and 2 deletions

View File

@@ -14,8 +14,6 @@
#include <QObject>
#include <QPointer>
#include <memory>
QT_BEGIN_NAMESPACE
class QMenu;
class QTimer;
@@ -50,6 +48,8 @@ public:
static ClangdClient *clientForProject(const ProjectExplorer::Project *project);
static ClangdClient *clientForFile(const Utils::FilePath &file);
static void updateStaleIndexEntries();
private:
void followSymbol(const CppEditor::CursorInEditor &data,
const Utils::LinkHandler &processLinkCallback, bool resolveTarget,