aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel/clangbackendreceiver.cpp
diff options
context:
space:
mode:
authorIvan Donchevskii <[email protected]>2018-01-19 09:18:57 +0100
committerIvan Donchevskii <[email protected]>2018-02-02 07:01:59 +0000
commitd81580b7a3a2c8ab7cca1552717a3e1151a470eb (patch)
tree4881f9ec0099c70e75816c786fd29957b7d21d70 /src/plugins/clangcodemodel/clangbackendreceiver.cpp
parentbdd5066665b47b57c6caff9b44c27665d77b0d3c (diff)
Clang: extra clangbackend job to collect full token info
Limit document annotations job to only highlighting data collection and move more expensive calls into separate job that runs after it. Change-Id: Ie792a3f741ac45c81033dd5b3a20ed061604f927 Reviewed-by: Nikolai Kosjar <[email protected]>
Diffstat (limited to 'src/plugins/clangcodemodel/clangbackendreceiver.cpp')
-rw-r--r--src/plugins/clangcodemodel/clangbackendreceiver.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/plugins/clangcodemodel/clangbackendreceiver.cpp b/src/plugins/clangcodemodel/clangbackendreceiver.cpp
index 306dfb05f1a..7e970d6d7e5 100644
--- a/src/plugins/clangcodemodel/clangbackendreceiver.cpp
+++ b/src/plugins/clangcodemodel/clangbackendreceiver.cpp
@@ -202,20 +202,26 @@ void BackendReceiver::documentAnnotationsChanged(const DocumentAnnotationsChange
auto processor = ClangEditorDocumentProcessor::get(message.fileContainer().filePath());
- if (processor) {
- const QString projectPartId = message.fileContainer().projectPartId();
- const QString filePath = message.fileContainer().filePath();
- const QString documentProjectPartId = CppTools::CppToolsBridge::projectPartIdForFile(filePath);
- if (projectPartId == documentProjectPartId) {
- const quint32 documentRevision = message.fileContainer().documentRevision();
- processor->updateCodeWarnings(message.diagnostics(),
- message.firstHeaderErrorDiagnostic(),
- documentRevision);
- processor->updateHighlighting(message.tokenInfos(),
- message.skippedPreprocessorRanges(),
- documentRevision);
- }
+ if (!processor)
+ return;
+
+ const QString projectPartId = message.fileContainer().projectPartId();
+ const QString filePath = message.fileContainer().filePath();
+ const QString documentProjectPartId = CppTools::CppToolsBridge::projectPartIdForFile(filePath);
+ if (projectPartId != documentProjectPartId)
+ return;
+
+ const quint32 documentRevision = message.fileContainer().documentRevision();
+ if (message.onlyTokenInfos()) {
+ processor->updateTokenInfos(message.tokenInfos(), documentRevision);
+ return;
}
+ processor->updateCodeWarnings(message.diagnostics(),
+ message.firstHeaderErrorDiagnostic(),
+ documentRevision);
+ processor->updateHighlighting(message.tokenInfos(),
+ message.skippedPreprocessorRanges(),
+ documentRevision);
}
static