ClangCodeModel: Restart clangd on "internal" changes to non-open files

Our previous "openExtraFile" approach does not reliably trigger re-
indexing.

Task-number: QTCREATORBUG-26521
Change-Id: Ibb4008d9cc72afddf6709c6f9442426440b72d01
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-09-13 11:07:48 +02:00
parent 6bc66a0a90
commit a33b37bfaf
2 changed files with 58 additions and 51 deletions

View File

@@ -18,6 +18,7 @@
QT_BEGIN_NAMESPACE
class QMenu;
class QTimer;
class QWidget;
QT_END_NAMESPACE
@@ -85,10 +86,12 @@ private:
void claimNonProjectSources(ClangdClient *client);
void watchForExternalChanges();
void watchForInternalChanges();
void scheduleClientRestart(ClangdClient *client);
static ClangdClient *clientWithProject(const ProjectExplorer::Project *project);
Utils::FutureSynchronizer m_generatorSynchronizer;
QList<QPointer<ClangdClient>> m_clientsToRestart;
QTimer * const m_clientRestartTimer;
QHash<Utils::FilePath, QString> m_queuedShadowDocuments;
};