forked from qt-creator/qt-creator
Clang: Integrate highlighting results from backend
Change-Id: I2c3fb69aabfe075bde76d63eafc2ca370f17493c Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
eb2457869d
commit
7ce9ef9db4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user