forked from qt-creator/qt-creator
Clang: Reparse editor document on project change
Change-Id: If7dcdc370fd50fded996df80ab6c893b4ec1ad55 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -276,13 +276,16 @@ const QSet<Utf8String> &TranslationUnit::dependedFilePaths() const
|
||||
return d->dependedFilePaths;
|
||||
}
|
||||
|
||||
void TranslationUnit::setDirtyIfProjectPartIsOutdated()
|
||||
{
|
||||
if (projectPartIsOutdated())
|
||||
setDirty();
|
||||
}
|
||||
|
||||
void TranslationUnit::setDirtyIfDependencyIsMet(const Utf8String &filePath)
|
||||
{
|
||||
if (d->dependedFilePaths.contains(filePath) && isMainFileAndExistsOrIsOtherFile(filePath)) {
|
||||
d->needsToBeReparsed = true;
|
||||
d->hasNewDiagnostics = true;
|
||||
d->hasNewHighlightingInformations = true;
|
||||
}
|
||||
if (d->dependedFilePaths.contains(filePath) && isMainFileAndExistsOrIsOtherFile(filePath))
|
||||
setDirty();
|
||||
}
|
||||
|
||||
SourceLocation TranslationUnit::sourceLocationAt(uint line, uint column) const
|
||||
@@ -369,6 +372,13 @@ bool TranslationUnit::projectPartIsOutdated() const
|
||||
return d->projectPart.lastChangeTimePoint() >= d->lastProjectPartChangeTimePoint;
|
||||
}
|
||||
|
||||
void TranslationUnit::setDirty()
|
||||
{
|
||||
d->needsToBeReparsed = true;
|
||||
d->hasNewDiagnostics = true;
|
||||
d->hasNewHighlightingInformations = true;
|
||||
}
|
||||
|
||||
bool TranslationUnit::isMainFileAndExistsOrIsOtherFile(const Utf8String &filePath) const
|
||||
{
|
||||
if (filePath == d->filePath)
|
||||
|
||||
Reference in New Issue
Block a user