forked from qt-creator/qt-creator
QmlJS semantic highlighter: Use document instead of widget
Diagnostic ranges also move to document for this. Change-Id: I82a9909abb57594cdd732448270849e6a2e3a4e0 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -119,7 +119,7 @@ void QmlJSTextEditorWidget::ctor()
|
||||
m_outlineModel = new QmlOutlineModel(this);
|
||||
m_contextPane = 0;
|
||||
m_findReferences = new FindReferences(this);
|
||||
m_semanticHighlighter = new SemanticHighlighter(this);
|
||||
m_semanticHighlighter = new SemanticHighlighter(m_qmlJsEditorDocument);
|
||||
|
||||
setParenthesesMatchingEnabled(true);
|
||||
setMarksVisible(true);
|
||||
@@ -189,11 +189,7 @@ int QmlJSTextEditorWidget::editorRevision() const
|
||||
|
||||
QVector<QTextLayout::FormatRange> QmlJSTextEditorWidget::diagnosticRanges() const
|
||||
{
|
||||
// this exist mainly because getting the tooltip from the additional formats
|
||||
// requires the use of private api (you have to extract it from
|
||||
// cursor.block().layout()->specialInfo.addFormatIndex (for the .format through .formats.at()),
|
||||
// and use .addFormat to get the range). So a separate bookkeeping is used.
|
||||
return m_diagnosticRanges;
|
||||
return m_qmlJsEditorDocument->diagnosticRanges();
|
||||
}
|
||||
|
||||
bool QmlJSTextEditorWidget::isSemanticInfoOutdated() const
|
||||
|
||||
Reference in New Issue
Block a user