forked from qt-creator/qt-creator
ClangCodeModel: Force clangd restart on external changes
Neither we nor clangd can afford to watch all source files, which means that after e.g. a branch switch we can easily end up in an inconsistent state. We alleviate this problem by restarting clangd if at least one open file was changed externally. Change-Id: I7e0d14835e3afbd7a64c3233614f2161282dddc0 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <utils/id.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -133,6 +134,7 @@ private:
|
||||
const CppEditor::ProjectInfo::ConstPtr &projectInfo);
|
||||
ClangdClient *createClient(ProjectExplorer::Project *project, const Utils::FilePath &jsonDbDir);
|
||||
void claimNonProjectSources(ClangdClient *fallbackClient);
|
||||
void watchForExternalChanges();
|
||||
|
||||
private:
|
||||
UiHeaderOnDiskManager m_uiHeaderOnDiskManager;
|
||||
@@ -144,6 +146,7 @@ private:
|
||||
|
||||
QHash<ProjectExplorer::Project *, ClangProjectSettings *> m_projectSettings;
|
||||
Utils::FutureSynchronizer m_generatorSynchronizer;
|
||||
QList<QPointer<ClangdClient>> m_clientsToRestart;
|
||||
};
|
||||
|
||||
class ClangModelManagerSupportProvider : public CppEditor::ModelManagerSupportProvider
|
||||
|
||||
Reference in New Issue
Block a user