CppTools: CppHighlightingSupport takes a BaseTextDocument

...instead an ITextEditor.

The ITextEditor was only used to access the file path and QTextDocument
via the BaseTextEditorWidget.

Change-Id: Idef2b8162b992fe3718e16e2a046e2ff214846f2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-06-06 11:52:09 -04:00
parent fc7f5ba364
commit a6e04c363f
15 changed files with 53 additions and 45 deletions

View File

@@ -121,7 +121,7 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
, m_initialized(false)
, m_lastHighlightRevision(0)
, m_lastHighlightOnCompleteSemanticInfo(true)
, m_highlightingSupport(modelManager->highlightingSupport(textEditor))
, m_highlightingSupport(modelManager->highlightingSupport(textEditor->baseTextDocument()))
, m_completionAssistProvider(
modelManager->completionAssistProvider(textEditor->document()->mimeType()))
{
@@ -595,7 +595,8 @@ void CppEditorSupport::onMimeTypeChanged()
m_highlighter.cancel();
m_highlighter.waitForFinished();
m_highlightingSupport.reset(m_modelManager->highlightingSupport(m_textEditor));
m_highlightingSupport.reset(
m_modelManager->highlightingSupport(m_textEditor->baseTextDocument()));
disconnect(this, SIGNAL(semanticInfoUpdated(CppTools::SemanticInfo)),
this, SLOT(startHighlighting()));