Clang: Reparse only if files are changed

Includes are now watched by a file watcher. Unsaved file changes are
watched too. If they are changed the translation units which depend on
them are set to a state which require a reparse. Later the diagnostics
of this units are collected and send back to creator.

Change-Id: I2fb5c7dd6644687f22399edd8d18edd6215c9505
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-08-31 12:40:14 +02:00
parent aa6aaee510
commit f2b7371af1
39 changed files with 800 additions and 242 deletions

View File

@@ -31,7 +31,9 @@
#include <diagnostic.h>
#include <diagnosticset.h>
#include <projectpart.h>
#include <projects.h>
#include <translationunit.h>
#include <translationunits.h>
#include <unsavedfiles.h>
#include <sourcelocation.h>
#include <sourcerange.h>
@@ -75,10 +77,12 @@ class FixIt : public ::testing::Test
{
protected:
ProjectPart projectPart{Utf8StringLiteral("projectPartId")};
UnsavedFiles unsavedFiles;
ClangBackEnd::ProjectParts projects;
ClangBackEnd::UnsavedFiles unsavedFiles;
ClangBackEnd::TranslationUnits translationUnits{projects, unsavedFiles};
TranslationUnit translationUnit{Utf8StringLiteral(TESTDATA_DIR"/diagnostic_fixit.cpp"),
unsavedFiles,
projectPart};
projectPart,
translationUnits};
DiagnosticSet diagnosticSet{translationUnit.diagnostics()};
Diagnostic diagnostic{diagnosticSet.front()};
::FixIt fixIt{diagnostic.fixIts().front()};