summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolseditorsupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cpptoolseditorsupport.cpp')
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index 45d970d475..7993ccd7dd 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -115,10 +115,16 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
, m_cachedContentsEditorRevision(-1)
, m_initialized(false)
, m_lastHighlightRevision(0)
+ , m_highlightingSupport(modelManager->highlightingSupport(textEditor))
{
connect(m_modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
this, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)));
+ if (m_highlightingSupport && m_highlightingSupport->requiresSemanticInfo()) {
+ connect(this, SIGNAL(semanticInfoUpdated(CppTools::SemanticInfo)),
+ this, SLOT(startHighlighting()));
+ }
+
m_updateDocumentTimer = new QTimer(this);
m_updateDocumentTimer->setSingleShot(true);
m_updateDocumentTimer->setInterval(m_updateDocumentInterval);
@@ -135,6 +141,8 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
connect(m_textEditor->document(), SIGNAL(mimeTypeChanged()),
this, SLOT(onMimeTypeChanged()));
+
+ updateDocument();
}
CppEditorSupport::~CppEditorSupport()