CompilationDatabase: Refresh the tree on the JSON file update

Reparse the compile_commands.json file when it has changed.

Fixes: QTCREATORBUG-21733
Change-Id: I8e5a99efd136b1d46a417817bde5b5b989109eea
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-03-14 11:09:36 +01:00
parent 429eb73ace
commit ed43e6d99f
2 changed files with 26 additions and 8 deletions

View File

@@ -26,8 +26,8 @@
#pragma once
#include <projectexplorer/project.h>
#include <texteditor/texteditor.h>
#include <utils/filesystemwatcher.h>
#include <QFutureWatcher>
@@ -51,11 +51,14 @@ public:
bool needsBuildConfigurations() const override { return false; }
private:
void reparseProject(const Utils::FileName &projectFile);
void buildTreeAndProjectParts(const Utils::FileName &projectFile);
QFutureWatcher<void> m_parserWatcher;
std::unique_ptr<CppTools::CppProjectUpdater> m_cppCodeModelUpdater;
std::unique_ptr<ProjectExplorer::Kit> m_kit;
Utils::FileSystemWatcher m_fileSystemWatcher;
bool m_hasTarget = false;
};
class CompilationDatabaseEditorFactory : public TextEditor::TextEditorFactory