forked from qt-creator/qt-creator
QmlJSEditor: Force a semantic rehighlight when a dependency changes.
Since the revision of the current document doesn't change, we don't get rid of errors due to missing dependencies otherwise. Reviewed-by: Kai Koehne
This commit is contained in:
@@ -638,7 +638,7 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
m_semanticRehighlightTimer = new QTimer(this);
|
||||
m_semanticRehighlightTimer->setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL);
|
||||
m_semanticRehighlightTimer->setSingleShot(true);
|
||||
connect(m_semanticRehighlightTimer, SIGNAL(timeout()), this, SLOT(semanticRehighlight()));
|
||||
connect(m_semanticRehighlightTimer, SIGNAL(timeout()), this, SLOT(forceSemanticRehighlight()));
|
||||
|
||||
connect(this, SIGNAL(textChanged()), this, SLOT(updateDocument()));
|
||||
connect(this, SIGNAL(textChanged()), this, SLOT(updateUses()));
|
||||
@@ -1212,6 +1212,11 @@ QString QmlJSTextEditor::insertParagraphSeparator(const QTextCursor &) const
|
||||
return QLatin1String("}\n");
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::forceSemanticRehighlight()
|
||||
{
|
||||
m_semanticHighlighter->rehighlight(currentSource(/* force = */ true));
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::semanticRehighlight()
|
||||
{
|
||||
m_semanticHighlighter->rehighlight(currentSource());
|
||||
|
Reference in New Issue
Block a user