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:
Christian Kamm
2010-04-06 11:57:08 +02:00
parent f90eacd8b5
commit 173fad0d3f
2 changed files with 7 additions and 1 deletions

View File

@@ -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());