summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2017-01-17 15:27:31 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-01-24 14:41:48 +0000
commit0b8df41387005156ea73b029f4d9d77f91ce5eb5 (patch)
tree6b44cb326108dff1c0b37322741aaa3da646fb2b /src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
parent19eaf87ef95a510351557119a955223a4aeea7b3 (diff)
downloadqt-creator-0b8df41387005156ea73b029f4d9d77f91ce5eb5.tar.gz
CppTools: Provide hints about chosen project part for editor document
Parse issues can have multiple reasons (invalid kit, not a project file, actual parse issue) and we should be able to tell them apart. With this change, we can distinguish between the fallback project part and a ambiguous project part. Follow up changes will use this to display more accurate diagnostics. Change-Id: Icc8767607cc17dc14d6227b07f34e81ba5525a96 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp')
-rw-r--r--src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
index 9104d5d116..05874085c0 100644
--- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
+++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
@@ -80,6 +80,9 @@ ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(
connect(&m_updateTranslationUnitTimer, &QTimer::timeout,
this, &ClangEditorDocumentProcessor::updateTranslationUnitIfProjectPartExists);
+ connect(m_parser.data(), &ClangEditorDocumentParser::projectPartInfoUpdated,
+ this, &BaseEditorDocumentProcessor::projectPartInfoUpdated);
+
// Forwarding the semantic info from the builtin processor enables us to provide all
// editor (widget) related features that are not yet implemented by the clang plugin.
connect(&m_builtinProcessor, &CppTools::BuiltinEditorDocumentProcessor::cppDocumentUpdated,
@@ -302,7 +305,7 @@ static bool isProjectPartLoadedOrIsFallback(CppTools::ProjectPart::Ptr projectPa
void ClangEditorDocumentProcessor::updateProjectPartAndTranslationUnitForEditor()
{
- const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPart();
+ const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPartInfo().projectPart;
if (isProjectPartLoadedOrIsFallback(projectPart)) {
registerTranslationUnitForEditor(projectPart.data());