From dbc3332b8e1442c0903e129586c08986ce752ff9 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 7 Feb 2012 15:09:08 +0100 Subject: C++: Moved completion/highlighting into the model manager. This way the editor does not need to know all the details of instantiating or maintaining classes for highlighting and/or completion, it can just ask the model manager. The change also enables different highlighting- or completion-engines without changes to the cppeditor. Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a Reviewed-by: Leandro Melo --- src/plugins/cpptools/cpptoolseditorsupport.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cpptoolseditorsupport.cpp') diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index ee69b4fabf..3f3c3c8a50 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -30,6 +30,8 @@ ** **************************************************************************/ +#include "cppcompletionsupport.h" +#include "cpphighlightingsupport.h" #include "cpptoolseditorsupport.h" #include "cppmodelmanager.h" @@ -44,13 +46,16 @@ #include +using namespace CppTools; using namespace CppTools::Internal; using namespace CPlusPlus; CppEditorSupport::CppEditorSupport(CppModelManager *modelManager) : QObject(modelManager), _modelManager(modelManager), - _updateDocumentInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL) + _updateDocumentInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL), + m_completionSupport(new CppCompletionSupport(this)), + m_highlightingSupport(new CppHighlightingSupport) { _revision = 0; @@ -98,6 +103,16 @@ unsigned CppEditorSupport::editorRevision() const return 0; } +CppTools::CppCompletionSupport *CppEditorSupport::completionSupport() const +{ + return m_completionSupport.data(); +} + +CppHighlightingSupport *CppEditorSupport::highlightingSupport() const +{ + return m_highlightingSupport.data(); +} + int CppEditorSupport::updateDocumentInterval() const { return _updateDocumentInterval; } -- cgit v1.2.1