From fda21898fbc9365c0503b9512e65134cf737181f Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 4 May 2017 11:49:31 +0200 Subject: Clang: Simplify triggering initialization of supportive translation unit Use a flag to indicate whether a supportive translation unit should be set up. It will be needed in a follow-up change, too. Change-Id: I6858caa303fcd9dca9486607380240dd5895a14a Reviewed-by: David Schulz --- src/tools/clangbackend/ipcsource/clangdocument.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/tools/clangbackend/ipcsource/clangdocument.cpp') diff --git a/src/tools/clangbackend/ipcsource/clangdocument.cpp b/src/tools/clangbackend/ipcsource/clangdocument.cpp index a267caa20d..9415db32fc 100644 --- a/src/tools/clangbackend/ipcsource/clangdocument.cpp +++ b/src/tools/clangbackend/ipcsource/clangdocument.cpp @@ -77,6 +77,7 @@ public: bool hasParseOrReparseFailed = false; bool isUsedByCurrentEditor = false; bool isVisibleInEditor = false; + bool increaseResponsiveness = false; }; DocumentData::DocumentData(const Utf8String &filePath, @@ -213,6 +214,23 @@ void Document::setDocumentRevision(uint revision) d->documentRevision = revision; } +bool Document::isResponsivenessIncreased() const +{ + return d->translationUnits.size() > 1; +} + +bool Document::isResponsivenessIncreaseNeeded() const +{ + checkIfNull(); + + return d->increaseResponsiveness; +} + +void Document::setResponsivenessIncreaseNeeded(bool responsivenessIncreaseNeeded) +{ + d->increaseResponsiveness = responsivenessIncreaseNeeded; +} + bool Document::isUsedByCurrentEditor() const { checkIfNull(); -- cgit v1.2.1