Clang: Integrate highlighting results from backend

Change-Id: I2c3fb69aabfe075bde76d63eafc2ca370f17493c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-11-18 17:07:44 +01:00
committed by Nikolai Kosjar
parent eb2457869d
commit 7ce9ef9db4
61 changed files with 1855 additions and 393 deletions

View File

@@ -85,6 +85,7 @@ public:
uint documentRevision = 0;
bool needsToBeReparsed = false;
bool hasNewDiagnostics = true;
bool hasNewHighlightingInformations = true;
bool isUsedByCurrentEditor = false;
bool isVisibleInEditor = false;
};
@@ -239,6 +240,11 @@ bool TranslationUnit::hasNewDiagnostics() const
return d->hasNewDiagnostics;
}
bool TranslationUnit::hasNewHighlightingInformations() const
{
return d->hasNewHighlightingInformations;
}
DiagnosticSet TranslationUnit::diagnostics() const
{
d->hasNewDiagnostics = false;
@@ -268,6 +274,7 @@ void TranslationUnit::setDirtyIfDependencyIsMet(const Utf8String &filePath)
if (d->dependedFilePaths.contains(filePath) && isMainFileAndExistsOrIsOtherFile(filePath)) {
d->needsToBeReparsed = true;
d->hasNewDiagnostics = true;
d->hasNewHighlightingInformations = true;
}
}
@@ -302,6 +309,13 @@ Cursor TranslationUnit::cursor() const
return clang_getTranslationUnitCursor(cxTranslationUnit());
}
HighlightingInformations TranslationUnit::highlightingInformations() const
{
d->hasNewHighlightingInformations = false;
return highlightingInformationsInRange(cursor().sourceRange());
}
HighlightingInformations TranslationUnit::highlightingInformationsInRange(const SourceRange &range) const
{
CXToken *cxTokens = 0;